20 Jul
2006
20 Jul
'06
5:44 a.m.
Alexander Vodomerov wrote:
import Debug.Trace
main = do putStrLn "xxx" return (trace "yyy" ()) putStrLn "zzz"
only xxx and zzz is displayed. yyy is missing. Why trace is not working?
Nothing uses the value of (trace "yyy" ()), so it is never evaluated. Try this instead, which uses the value for a pattern match: () <- return (trace "yyy" ()) Or this, which makes the trace part of the sequence of IO actions: trace "yyy" (return ()) HTH, Tom
7323
Age (days ago)
7323
Last active (days ago)
0 comments
1 participants
participants (1)
-
tpledger@ihug.co.nz