I've had an idea for a monad tutorial that I think might be quite instructive, but haven't had the motivation yet to write.<p>In essence, the idea is that you are led through the process of implementing: early exit, nondeterminism, threaded state and coroutines using call/cc in scheme. Then monads are introduced as a way of typing those patterns.
Im not getting the idea of monads here. From my understanding monads does series of transformation( composition, unit , lift ) of a function to do its task. So does monad is similar to Adapter pattern in java? which does make two classes work even though they aren't meant to work.<p>Because it does transform the class/ interface to work with other class, right?<p>Am I missing anything here?
Monads, applicatives, functors, and monoids are different algebras. OK. That's really helpful, actually. (At least, I suspect it's going to be really helpful after I've thought about it for a few days.)<p>But monads are the way to do sequencing? Only if you insist on putting yourself in a functional straight-jacket that's so tight that you cannot escape. Then, yes, you do sequencing via monads because you don't have any other way to do it. But if you're a pragmatist rather than an ideologue, it seems more reasonable to just do sequence <i>by doing things in sequence</i>, rather than forcing yourself to do unnatural contortions.
<i>'there’s no such thing as the “IO monad” or the “List monad”'</i><p>I don't think I agree (depending on just what is meant by "such thing as")... I would say there is such thing as "the IO monad" in the same sense as there is such thing as "the rational field" or "the Z/5 group". It's a particular example of a more general algebraic structure, and you'd use the phrase when you're talking <i>particularly</i> about the structure as it occurs in that instance.