On Jan 10, 2008 8:54 PM, Luke Palmer <[EMAIL PROTECTED]> wrote:
> 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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to