I found this riff on datalog fun: https://www.rntz.net/files/datafun.pdf, https://www.youtube.com/watch?v=p_26-yTUlCU > Datalog may be considered either an unusually powerful query language or a carefully limited logic programming language. Datalog is declarative, expressive, and optimizable, and has been applied successfully in a wide variety of problem domains. However, most use-cases require extending Datalog in an application-specific manner. In this paper we define Datafun, an analogue of Datalog supporting higher-order functional programming. The key idea is to track monotonicity with types.
Closest would be the mini-Datafun impl in Racket, missing a lot of features https://github.com/rntz/datafun/blob/master/mini-datafun.rkt
Very interesting! A quick search of Datafun + Clojure shows no obvious hits other than the referenced paper. I wonder if anybody has looked at implementing Datafun in Clojure.