Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- registerDelay :: Int -> IO (TVar Bool)
- writeTVar :: TVar a -> a -> STM ()
- readTVar :: TVar a -> STM a
- newTVar :: a -> STM (TVar a)
- data TVar a
- mkWeakTVar :: TVar a -> IO () -> IO (Weak (TVar a))
- swapTVar :: TVar a -> a -> STM a
- stateTVar :: TVar s -> (s -> (a, s)) -> STM a
- modifyTVar' :: TVar a -> (a -> a) -> STM ()
- modifyTVar :: TVar a -> (a -> a) -> STM ()
- newTVarIO :: MonadIO m => a -> m (TVar a)
- readTVarIO :: MonadIO m => TVar a -> m a
- writeTVarIO :: MonadIO m => TVar a -> a -> m ()
- modifyTVarIO :: MonadIO m => TVar a -> (a -> a) -> m ()
- modifyTVarIO' :: MonadIO m => TVar a -> (a -> a) -> m ()
- stateTVarIO :: MonadIO m => TVar s -> (s -> (a, s)) -> m a
- swapTVarIO :: MonadIO m => TVar a -> a -> m a

# Documentation

registerDelay :: Int -> IO (TVar Bool) #

Switch the value of returned `TVar`

from initial value `False`

to `True`

after a given number of microseconds. The caveats associated with
`threadDelay`

also apply.

Shared memory locations that support atomic memory transactions.

stateTVar :: TVar s -> (s -> (a, s)) -> STM a #

Like `modifyTVar'`

but the function is a simple state transition that can
return a side value which is passed on as the result of the `STM`

.

*Since: stm-2.5.0*

modifyTVar' :: TVar a -> (a -> a) -> STM () #

Strict version of `modifyTVar`

.

*Since: stm-2.3*

modifyTVar :: TVar a -> (a -> a) -> STM () #

Mutate the contents of a `TVar`

. *N.B.*, this version is
non-strict.

*Since: stm-2.3*

readTVarIO :: MonadIO m => TVar a -> m a Source #

writeTVarIO :: MonadIO m => TVar a -> a -> m () Source #

modifyTVarIO :: MonadIO m => TVar a -> (a -> a) -> m () Source #

Non-strict version

modifyTVarIO' :: MonadIO m => TVar a -> (a -> a) -> m () Source #

Strict version

stateTVarIO :: MonadIO m => TVar s -> (s -> (a, s)) -> m a Source #

swapTVarIO :: MonadIO m => TVar a -> a -> m a Source #