"Alberto G. Corona " <[EMAIL PROTECTED]> writes:

> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to