
14 Aug
2007
14 Aug
'07
2:52 p.m.
On 2007-08-14, Dan Piponi
On 8/14/07, Sebastian Sylvan
wrote: I like the very light weight analogy (which works for most practical uses of monads) that a monadic action is a "recipe"
Many introductory programming books present the idea of a program as a recipe. Here's a recipe for computing factorials:
fact 0 = 1 fact n = n*fact (n-1)
Where do monads come in?
Playing the devil's advocate here: Recipe is a reasonable description for imperative code ... because it's all in the IO monad. Not such a good mapping for functional code. (I don't think recipe is a good analogy for, say, the List monad, reader monads, etc.) -- Aaron Denney -><-