|
|
|
|
|
by eli_gottlieb
4773 days ago
|
|
He's not begging the question at all. In formal PL terms, a monad and a computational effect (which includes continuations, nondeterminism, and I/O, and loads more interesting stuff) are very strongly connected concepts. If I remember correctly, they may even be equivalent. Monadic combinators are really just kind of type-sugar. Think: any ordering of computations can be expressed as a tree. However, the only ordering trees a pure-functional language must obey are call-trees (the parameters of a function must be computed before the results of a function, even after lazy-evaluation is taken into account). Monadic programming is a way to transform arbitrary ordering trees of possibly-dynamic depth and width into call trees while preserving the original ordering. The really neat thing about monads is that they statically guarantee they'll preserve the original ordering, despite its being of dynamic width and depth. |
|