> One other thing: since unsafePerformIO already has a NOINLINE 
> pragma on it,
> I don't think it's necessary to explicitly NOINLINE all these 
> top-level
> mutable thingies.

Oh yes it is:

foo :: IORef Int
foo = unsafePerformIO (newIORef 0)

baz :: IO Int
baz = do { v <- readIORef foo;
                writeIORef foo (v+1);
                return v }

Compare with:

baz :: IO Int
baz = do { v <- readIORef (unsafePerformIO (newIORef 0));
                writeIORef (unsafePerformIO (newIORef 0))(v+1);
                return v }

Simon

Reply via email to