> The idea behind a monad is to factor out the plumbing code so that its complexity is hidden, leaving only the composition of the functions visible.<p><i>cue light bulb coming on</i><p>Thanks so much for this article; I've been trying to understand monads forever now. The closest I got was the "burrito" analogy, but I always wanted a more mathematically sound intuition.<p>For helpful reference, here's a collection of monad tutorials and related pedagogy:<p>- Monads are burritos [<a href="https://speakerdeck.com/u/dimituri/p/a-monad-is-just-a-burrito" rel="nofollow">https://speakerdeck.com/u/dimituri/p/a-monad-is-just-a-burri...</a>] (slide deck)<p>- No, they really aren't [<a href="http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/" rel="nofollow">http://byorgey.wordpress.com/2009/01/12/abstraction-intuitio...</a>]<p>- Well yeah, they kinda are [<a href="http://blog.plover.com/prog/burritos.html" rel="nofollow">http://blog.plover.com/prog/burritos.html</a>]<p>- But anyway, you probably have already invented them yourself; you just didn't realize it [<a href="http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html" rel="nofollow">http://blog.sigfpe.com/2006/08/you-could-have-invented-monad...</a>]<p>- And even if you didn't, you can always learn about it from that crowd-sourced fountain of programmer knowledge, StackOverflow (and this question hasn't even been closed as "not constructive"!) [<a href="http://stackoverflow.com/questions/44965/what-is-a-monad" rel="nofollow">http://stackoverflow.com/questions/44965/what-is-a-monad</a>]<p>- Of course, once you understand basic category theory, you should be set anyway. What are you, some kind of Java programmer? [<a href="http://reperiendi.wordpress.com/2007/11/03/category-theory-for-the-java-programmer/" rel="nofollow">http://reperiendi.wordpress.com/2007/11/03/category-theory-f...</a>]<p>- But really, a monad is just a monoid in the category of endofunctors, what's the problem? [<a href="http://stackoverflow.com/questions/3870088/a-monad-is-just-a-monoid-in-the-category-of-endofunctors-whats-the-problem" rel="nofollow">http://stackoverflow.com/questions/3870088/a-monad-is-just-a...</a>]