Ticket #7364 (closed bug: wontfix)
`foo !f = id . f` becomes non-strict with -O2
|Reported by:||shachaf||Owned by:|
|Type of failure:||Incorrect result at runtime||Difficulty:||Unknown|
|Test Case:||Blocked By:|
The following program:
foo :: (a -> b) -> a -> b foo !f = id . f main :: IO () main = print (foo undefined `seq` "ok")
Crashes with Prelude.undefined when compiled without -O2, but prints "ok" with it. As far as I can tell the optimizer shouldn't be allowed to do that.