Monads are a class of hard drugs(lambda-diode.com)
lambda-diode.com
Monads are a class of hard drugs
http://lambda-diode.com/programming/monads-are-a-class-of-hard-drugs
6 comments
wrt "darcs is slow": the darcs source repo is 59M and took 3:27 for me to clone. Git's repo is 117M and took 6:02 to clone. So per repo size they're pretty similar. Darcs has its issues, but under normal conditions it's not notably slower than git.
Writing a monad blog post is obligatory for all who know monads. Here's mine: a monad is a class with a sensible flatMap operation. Hope that helps you understand monads...
I suspect Haskell is a bit faster now than it was in early 2008.
on that note, can the mods add a [2008] to the title please?
I'd suggest just flagging it away. It is out of date, and was actively wrong and full of misperceptions even in 2008. There's no virtue to keeping it here now.
> The essence of monads is to use abstract types to enclose a mutable state
That's not really true. Many types that are monads are just data. Some trivial examples: List, Maybe, Either, Free. There are several other misunderstandings in the post.
> For one thing, when you use a monad, you get hooked to it: the type constructors of the monad start to appear in the signatures of your function.
Only if you write unmaintainable code. I wrote a full RFC 2616 HTTP server and basically every function lives inside a completely parameterized monad type `m`. All of the dependencies each function needs are injected as arguments (See http://www.haskellforall.com/2012/05/scrap-your-type-classes...).
Also these days (though not when the article was written in 2008), free monad DSLs are becoming a very popular way to abstract away this stuff (See http://degoes.net/articles/modern-fp)