18.03.2013 13:26, Alexander V Vershilov ?????: I can not use atomicModifyIORef because it works with pure computation
atomicModifyIORef :: IORef <http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-IORef.html#t:IORef> a -> (a -> (a, b)) -> IO <http://hackage.haskell.org/packages/archive/base/latest/doc/html/System-IO.html#t:IO> b nor STM, becuase IO is not acceptable inside STM transaction. I just need some thread-safe blocking variable like MVar modifyMVar :: MVar <http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/Control-Concurrent-MVar.html#t:MVar> a -> (a -> IO <http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/System-IO.html#t:IO> (a, b)) -> IO <http://hackage.haskell.org/packages/archive/base/4.6.0.1/doc/html/System-IO.html#t:IO> b
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
