
15 Sep
2009
15 Sep
'09
9:59 p.m.
But pedantically even the function:
quux :: Int -> Int quux x = trace "Quux" (bar 12)
optmain :: IO () optmain = quux 10 `seq` quux 11 `seq` return ()
might print only once if GHC at the optimization level selected recognizes that quux doesn't depend on its argument and rewrote your code with more sharing.
Well to be specific, it depends on how you define "function", quux :: Int -> Int quux = trace "Quux" bar will print "Quux" once under the naive semantics.