Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Concurrency useful and common functions.
- data MVar a :: * -> *
- newEmptyMVar :: MonadIO m => m (MVar a)
- newMVar :: MonadIO m => a -> m (MVar a)
- putMVar :: MonadIO m => MVar a -> a -> m ()
- readMVar :: MonadIO m => MVar a -> m a
- swapMVar :: MonadIO m => MVar a -> a -> m a
- takeMVar :: MonadIO m => MVar a -> m a
- tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- data STM a :: * -> *
- data TVar a :: * -> *
- atomically :: MonadIO m => STM a -> m a
- newTVarIO :: MonadIO m => a -> m (TVar a)
- readTVarIO :: MonadIO m => TVar a -> m a
- modifyTVar' :: TVar a -> (a -> a) -> STM ()
- newTVar :: a -> STM (TVar a)
- readTVar :: TVar a -> STM a
- writeTVar :: TVar a -> a -> STM ()
MVar
An MVar
(pronounced "em-var") is a synchronising variable, used
for communication between concurrent threads. It can be thought of
as a a box, which may be empty or full.
newEmptyMVar :: MonadIO m => m (MVar a) Source #
Lifted to MonadIO
version of newEmptyMVar
.
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool Source #
Lifted to MonadIO
version of tryPutMVar
.
tryReadMVar :: MonadIO m => MVar a -> m (Maybe a) Source #
Lifted to MonadIO
version of tryReadMVar
.
tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a) Source #
Lifted to MonadIO
version of tryTakeMVar
.
STM
A monad supporting atomic memory transactions.
Monad STM | Since: 4.3.0.0 |
Functor STM | Since: 4.3.0.0 |
Applicative STM | Since: 4.8.0.0 |
Alternative STM | Since: 4.8.0.0 |
MonadPlus STM | Since: 4.3.0.0 |
Shared memory locations that support atomic memory transactions.
atomically :: MonadIO m => STM a -> m a Source #
Lifted to MonadIO
version of atomically
.
readTVarIO :: MonadIO m => TVar a -> m a Source #
Lifted to MonadIO
version of readTVarIO
.
modifyTVar' :: TVar a -> (a -> a) -> STM () #
Strict version of modifyTVar
.