
19 Jul
2006
19 Jul
'06
5:44 p.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
6881
Age (days ago)
6881
Last active (days ago)
0 comments
1 participants
participants (1)
-
tpledger@ihug.co.nz