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 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe