5 ms·
You Could Have Invented Monads (And Maybe You Already Have)
- jrockway 17y agoThe only blog-style "monad tutorial" anyone should read. (Everyone should read Meet The Monads and the Typeclassopedia, of course.)
- Xichekolas 17y agoFunny you should mention the Typeclassopedia. The guy who wrote the Typeclassopedia (Brent Yorgey) is coming to speak to my local functional languages group up on campus tomorrow. In the process of googling him, I came across both the Typeclassopedia and this article, and both were excellent. This tutorial was just one of the those "aha!" moments in my life, and I wanted to share.
- tumult 17y agoIn addition to this, another great Haskell+monads learning source is Real World Haskell, whose exercises will have you implement your own monads without telling you, and then reveal the surprise later. Well, it would have been a surprise, but I just spoiled it. Anyway, get reading :)
- a-priori 17y agoThis is the explanation of Monads that made it click for me. I actually had déja vu because I had written code very much like this before in Haskell. It got ugly real quick, and I remember thinking 'there has to be a better way of doing this'. Turns out I was right.
- barrkel 17y agoAnother excellent introduction to monads for experienced imperative programmers, particularly those familiar with C#, is here: http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels...
- pmiller2 17y agoHere is my favorite monad tutorial: http://www.valuedlessons.com/2008/01/monads-in-python-with-nice-syntax.html http://www.valuedlessons.com/2008/01/monads-in-python-with-n... . The reason I like it is because it uses Python rather than Haskell while pointing out that you can build monads in any language that supports objects or closures. Actually, now that I think about it, it seems to me that pythonic monads should really be context managers, so they can be used like: with SomeMonad: do stuff