Haskell version of Dedalus (with some datomic-type stuff)