On 13/08/07, David Roundy <[EMAIL PROTECTED]> wrote:
>
> 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

-- 
[EMAIL PROTECTED]
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to