Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
TVars with a dirty bit that allows for one listener
- data DTVar a
- newDTVar :: a -> STM (DTVar a)
- newDTVarIO :: a -> IO (DTVar a)
- writeDTVar :: DTVar a -> a -> STM ()
- writeDTVarIO :: DTVar a -> a -> IO ()
- readDTVar :: DTVar a -> STM a
- readDTVarIO :: DTVar a -> IO a
- listenDTVar :: DTVar a -> STM a
- listenDTVarIO :: DTVar a -> IO a
- listenDTVars :: [DTVar a] -> STM [a]
- listenDTVarsIO :: [DTVar a] -> IO [a]
- modifyDTVar :: DTVar a -> (a -> a) -> STM ()
Documentation
writeDTVar :: DTVar a -> a -> STM () Source
Write a value to a DTVar, making it dirty
writeDTVarIO :: DTVar a -> a -> IO () Source
writeDTVar
in IO
listenDTVar :: DTVar a -> STM a Source
Listens until the dirty bit is true, then removes the dirty bit and returns the read element
listenDTVarIO :: DTVar a -> IO a Source
listenDTVar
in IO
listenDTVars :: [DTVar a] -> STM [a] Source
Listen until any of the dirty bits are true, then removes all dirty bits
and returns all DTVar
's values, in order.
listenDTVarsIO :: [DTVar a] -> IO [a] Source
listenDTVars
in IO
modifyDTVar :: DTVar a -> (a -> a) -> STM () Source
Modify a DTVar, making it dirty.