3 ms·
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
by eru 17y ago
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.)
- jrockway 17y ago"A monad is like a functor, except there is also a 'join' operation."
- eru 17y agoDon't forget about pointed functors in between, i.e. return.
- jrockway 17y agoYeah. 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 :)
- eru 17y agoYou 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.
- camccann 17y agoI 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 http://ncatlab.org/nlab/show/monoid#examples_6 [1] http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html http://james-iry.blogspot.com/2009/05/brief-incomplete-and-m...