Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 33, Issue 9

2006-05-11 Thread Albert Lai
"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 b

[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 33, Issue 9

2006-05-11 Thread Alberto G. Corona
Hi, I´m trying to make a searchable transactional cache using STM. The whole idea is to use indexed TVar variables using a FiniteMap. another TVar holds the finitemap . This last TVar has to be a global variable. I found that when handled as global, a TVar does not keep the state. For example: s