22 ms·
- Don't read the monad tutorials. - No really, don't read the monad tutorials. - Learn about Haskell types. - Learn what a typeclass is. - Read
by cgag 12y ago
- Don't read the monad tutorials.
- No really, don't read the monad tutorials.
- Learn about Haskell types.
- Learn what a typeclass is.
- Read the Typeclassopedia.
- Read the monad definitions.
- Use monads in real code.
- Don't write monad-analogy tutorials.
http://dev.stephendiehl.com/hask/#monads http://dev.stephendiehl.com/hask/#monads
- mercurial 12y agoOn the other hand, the classic http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html http://blog.sigfpe.com/2006/08/you-could-have-invented-monad... takes you (gently) through code, and you find out at the end that you have written a monad.
- GregBuchholz 12y agoI think the best way to learn about monads is to write a monad tutorial. If nothing else it is a rite-of-passage.
- rwosync 12y agoPlease don't do this. We have enough problems communicating this concept as it is.
- e12e 12y agoPlease do write one. Please don't publish one. Writing is a great way to think. Without yet really understanding monads, I've come to realize that their only real problem is the name -- being named after some rather obscure (for most!) category theory concept -- that itself seems just about as simple and trivial as monads are. I find they are a little like the y-combinator in that regard. I'm not sure if what we need is category theory in elementary school, or a different framework for discussing monads as it relates to programming -- but I'm almost convinced the confusion has to do with the language used to describe them. Programming is a very practical art that sits on top of the much more abstract art of mathematics. It's useful to know orders of magnitude, graph theory, statistics, logic... but the art by which these concepts are animated and put to use is rather prosaic. And the discipline of computing has forged a set of concepts that are "appropriately abstract" (much, I think due to Knuth) -- but monads seem to lie just outside the grasp of many programmers. And I don't think it is because they are a particularly intrinsically hard concept.
- cageface 12y agoI think the best way to explain monads, at least to programmers with any real experience, is just to show a lot of examples of how they can be used to solve real problems. I went through dozens of explanations before the light finally went on and I saw what a simple concept a monad really is. All the crazy analogies and jargon-heavy discussions only serve to obscure what is really not a complicated idea at all.