We've seen the Free Monad, The Reader Monad and the IO Monad in Clojure.
We've seen the Eff Monad - which is a better Monad transformer in Haskell.
We've also seen Monad Transformers, and the free Monad transformer in Clojure.
Daniel Spiewak has sought to improve on the Eff Monad, with the Emm Monad in Scala. It looks like this:
def readName: Task[String] = ???
def log(msg: String): Task[Unit] = ???
type E = Task |: Option |: Base
val effect: Emm[E, String] = for {
first <- readName.liftM[E]
last <- readName.liftM[E]
name <- (if ((first.length * last.length) < 20) Some(s"$first $last") else None).liftM[E]
_ <- log(s"successfully read in $name").liftM[E]
} yield name
My question is: Is it possible to do the Eff Monad in Clojure?