Threading monads

Jan-Willem Maessen jmaessen@MIT.EDU
Thu, 10 Apr 2003 15:52:56 -0400


Mark Carroll <mark@chaos.x-philes.com> writes:
> [a definition of unfold in terms of monadic unfold in the identity
> monad]
> 
> Is this a good design idea? Are there better ones? Is myUnfoldr
> necessarily less efficient than a "normal" unfoldr that doesn't have
> monads underneath constraining evaluation order?

Actually, though the operations of most monads constrain evaluation
order, an interesting property of the identity monad is that it should
not do so.  This observation has led me to think long and hard about
the distinction between monadic and non-monadic computations in
Haskell (admittedly to no real conclusion).

-Jan-Willem Maessen
jmaessen@alum.mit.edu