
10 Jan
2008
10 Jan
'08
6:11 p.m.
On Jan 10, 2008 8:54 PM, Luke Palmer
Can someone explain what the heck is going on here?
AFAICT, nothing is wrong. You see, both returned the very same values. What you saw was in fact the problem with unsafePerformIO and friends, as they may be executed lots of times *or not*. The compiler is free to behave in those two ways for the code with const or with the lambda. But referential transparency wasn't broken at all =). It seems const retained the value, while the lambda didn't. An optimization might transform one into the other if the compiler sees fit. -- Felipe.