
13 Aug
2007
13 Aug
'07
6:35 p.m.
On 13/08/07, David Roundy
Try executing:
do { x <- return 2; undefined; return (x*x); }
in any monad you like, and you'll find that regardless of the *data* dependencies (the return value of this monadic action is unambiguous), the undefined is evaluated *before* the value 4 is returned. --
Prelude> :m + Control.Monad.Identity Prelude Control.Monad.Identity> runIdentity $ do { x <- return 2; undefined; return (x*x); } Loading package mtl-1.0 ... linking ... done. 4 -- Brian_Brunswick____brian@ithil.org____Wit____Disclaimer____!Shortsig_rules!