
20 Jul
2006
20 Jul
'06
7:35 a.m.
Alexander Vodomerov
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