[Haskell-cafe] Top-level TVars
joelr1 at gmail.com
Wed Dec 14 15:38:36 EST 2005
> On Wed, Dec 14, 2005 at 02:17:17PM -0000, Simon Marlow wrote:
>> Suppose you create two top-level IORefs with the same type, like
>> var1 = unsafePerformIO $ newIORef 0
>> var2 = unsafePerformIO $ newIORef 0
>> GHC's CSE optimisation will common these up - after all, it's the
>> expression, so it must yield the same result, right?
Do these have to be within the same module for the CSE optimization
to kick in?
More information about the Haskell-Cafe