
12 May
2006
12 May
'06
12:19 a.m.
"Alberto G. Corona "
stmcache= newTVar 0
I will explain what this doesn't with an analogy. import Data.IORef notglobal = newIORef True main = do a <- notglobal b <- notglobal writeIORef a False x <- readIORef b print x To better show what's going on, I also provide this for contrast: import Data.IORef import System.IO.Unsafe global = unsafePerformIO (newIORef True) main = do x <- readIORef global print x writeIORef global False x <- readIORef global print x