TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

You Could Have Invented Monads (And Maybe You Already Have)

34 pointsby Xichekolasover 15 years ago

5 comments

tumultover 15 years ago
In 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.<p>Well, it would have been a surprise, but I just spoiled it. Anyway, get reading :)
a-prioriover 15 years ago
This is the explanation of Monads that made it click for me.<p>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.
jrockwayover 15 years ago
The only blog-style "monad tutorial" anyone should read.<p>(Everyone should read Meet The Monads and the Typeclassopedia, of course.)
评论 #958855 未加载
barrkelover 15 years ago
Another excellent introduction to monads for experienced imperative programmers, particularly those familiar with C#, is here:<p><a href="http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx" rel="nofollow">http://blogs.msdn.com/wesdyer/archive/2008/01/11/the-marvels...</a>
pmiller2over 15 years ago
Here is my favorite monad tutorial: <a href="http://www.valuedlessons.com/2008/01/monads-in-python-with-nice-syntax.html" rel="nofollow">http://www.valuedlessons.com/2008/01/monads-in-python-with-n...</a> . 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.<p>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:<p><pre><code> with SomeMonad: do stuff</code></pre>