Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data TVar a
- newTVar :: a -> STM (TVar a)
- newTVarIO :: Member (Embed IO) r => a -> Sem r (TVar a)
- readTVar :: TVar a -> STM a
- readTVarIO :: Member (Embed IO) r => TVar a -> Sem r a
- writeTVar :: TVar a -> a -> STM ()
- modifyTVar :: TVar a -> (a -> a) -> STM ()
- modifyTVar' :: TVar a -> (a -> a) -> STM ()
- stateTVar :: TVar s -> (s -> (a, s)) -> STM a
- swapTVar :: TVar a -> a -> STM a
- registerDelay :: Member (Embed IO) r => Int -> Sem r (TVar Bool)
Documentation
Shared memory locations that support atomic memory transactions.
modifyTVar :: TVar a -> (a -> a) -> STM () #
Mutate the contents of a TVar
. N.B., this version is
non-strict.
Since: stm-2.3
modifyTVar' :: TVar a -> (a -> a) -> STM () #
Strict version of modifyTVar
.
Since: stm-2.3