Re:On Learning Haskell
by eru on Wednesday March 10, 2010 @12:49PM
(#1181472)
I have the perfect explanation for Monads: Monads are like everything that satisfies the three monad laws. (Of course this only helps mathematicians, if at all. Not mere mortals.)
[ Parent
| on HN ]
I don't see what even needs explanation. Really, monads are just a monoid object in an endofunctor category. [0] What's the problem? [1]
[0] http://ncatlab.org/nlab/show/monoid#examples_6
[1] http://james-iry.blogspot.com/2009/05/brief-incomplete-and-m...
"A monad is like a functor, except there is also a 'join' operation."
Don't forget about pointed functors in between, i.e. return.
Yeah. My mental picture is "thing with return/pure -> thing with fmap -> thing with join". The second is a pointed functor, the third is monad. Not sure what the first is, probably because it is nearly useless :)
You may have it backward. The mathematicians use "thing with fmap (functor) -> thing with return/pure (pointed functor) -> thing with join (monad)", as far as I know.
Arrows are another generalization of Monads that goes in a direction different from functors.