News for hackers. Stuff that matters.
Re:Snap: A Haskell Web Framework by chousuke on Sunday May 23, 2010 @09:55AM (#1372256)
My current understanding of monads is that they are just a formalisation and a generalisation of an execution (or composition) mechanism that is implicit in most languages.

For example, in a language like C, the active part of the program is a composition of statements that are "executed" one by one and in order. The IO monad in effect implements this strategy.

The big thing is that the monad abstraction allows for other composition strategies too. The Maybe monad for example could be compared to a language that keeps executing things one by one until one of the computations fails, which results in the entire computation yielding a null result.

The type system helps keep these different strategies separate from each other, so that eg. one can't execute in parallel operations that require sequential composition.

There are no comments on this comment yet.