Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data MVar a
- newEmptyMVar :: MonadIO m => m (MVar a)
- newMVar :: MonadIO m => a -> m (MVar a)
- takeMVar :: MonadIO m => MVar a -> m a
- putMVar :: MonadIO m => MVar a -> a -> m ()
- readMVar :: MonadIO m => MVar a -> m a
- swapMVar :: MonadIO m => MVar a -> a -> m a
- tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- isEmptyMVar :: MonadIO m => MVar a -> m Bool
- withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))
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.
Instances
NFData1 MVar | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
Eq (MVar a) | Since: base-4.1.0.0 |
NFData (MVar a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
PrimUnlifted (MVar a) | Since: primitive-0.6.4.0 |
Defined in Data.Primitive.UnliftedArray toArrayArray# :: MVar a -> ArrayArray# # fromArrayArray# :: ArrayArray# -> MVar a # |
newEmptyMVar :: MonadIO m => m (MVar a) #
Lifted newEmptyMVar
.
Since: unliftio-0.1.0.0
tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a) #
Lifted tryTakeMVar
.
Since: unliftio-0.1.0.0
tryPutMVar :: MonadIO m => MVar a -> a -> m Bool #
Lifted tryPutMVar
.
Since: unliftio-0.1.0.0
isEmptyMVar :: MonadIO m => MVar a -> m Bool #
Lifted isEmptyMVar
.
Since: unliftio-0.1.0.0
withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b #
Unlifted withMVar
.
Since: unliftio-0.1.0.0
withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b #
Unlifted withMVarMasked
.
Since: unliftio-0.1.0.0
modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () #
Unlifted modifyMVar_
.
Since: unliftio-0.1.0.0
modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b #
Unlifted modifyMVar
.
Since: unliftio-0.1.0.0
modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () #
Unlifted modifyMVarMasked_
.
Since: unliftio-0.1.0.0
modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b #
Unlifted modifyMVarMasked
.
Since: unliftio-0.1.0.0
tryReadMVar :: MonadIO m => MVar a -> m (Maybe a) #
Lifted tryReadMVar
.
Since: unliftio-0.1.0.0
mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a)) #
Unlifted mkWeakMVar
.
Since: unliftio-0.1.0.0