Post by jim
I also think this would be a great addition to clojure-contrib.
Me too. But who decides what goes into clojure-contrib? Rich?
Post by jim
Because of the way most monad tutorials are written, monads seem to be
pretty hard to get your head around. Also, many of the reasons for
the standard monads in Haskell don't exist in impure functional
languages like Clojure. So there's less motivation to understand
them. But I found that once I understood them, they are a powerful
addition to my conceptual toolbox.
I agree. I see monads as the functional equivalent to aspect-oriented
programming: a way to implement separation of concerns.
I also think that some aspects of monads are clearer in Clojure than
they are in Haskell. Haskell's way to implement monads as data types
has some practical advantages, but it also obscures the algorithmic
nature of monads a bit. Moreover, it makes some things impossible,
for example executing a single piece of code under different monads
(easy in Clojure by having the monad as a variable), which is quite
handy sometimes, e.g. for debugging. I also prefer monad transformers
implemented as functions to monad transformers implemented as pretty
complicated abstract data types with boilerplate code to get data in
and out. In the long run, we should have a monad tutorial for
Clojure, rather then let everyone learn Haskell first.