Alexander Vodomerov <[EMAIL PROTECTED]> wrote:

> main = do
>   putStrLn "xxx"
>   return (trace "yyy" ())
>   putStrLn "zzz"
> 
> only xxx and zzz is displayed. yyy is missing.

This is because you never demanded the value of (trace "yyy" ()), so it
was never computed.  The joys of laziness!  To force its evaluation try

  main = do
    putStrLn "xxx"
    () <- return (trace "yyy" ())
    putStrLn "zzz"

Regards,
    Malcolm
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to