Curious behaviour of irrefutable pattern.

Simon Peyton-Jones simonpj at
Thu Dec 21 16:32:23 EST 2006

| Do you mean if I have both an infinite loop and an error call, then I
| might get only the loop?


f x = error "urk"
loop n = loop (n+1)
main = print (f (loop 0))

The compiler figures out that f is strict, and uses call by value.  Result is a loop.


More information about the Glasgow-haskell-users mailing list