unliftio-0.2.8.0: The MonadUnliftIO typeclass for unlifting monads to IO (batteries included)

Safe HaskellSafe
LanguageHaskell2010

UnliftIO.MVar

Description

Unlifted Control.Concurrent.MVar.

Since: unliftio-0.1.0.0

Synopsis

Documentation

data MVar a #

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

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> MVar a -> () #

Eq (MVar a)

Since: base-4.1.0.0

Instance details

Defined in GHC.MVar

Methods

(==) :: MVar a -> MVar a -> Bool #

(/=) :: MVar a -> MVar a -> Bool #

NFData (MVar a)

NOTE: Only strict in the reference and not the referenced value.

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: MVar a -> () #

newEmptyMVar :: MonadIO m => m (MVar a) Source #

Lifted newEmptyMVar.

Since: unliftio-0.1.0.0

newMVar :: MonadIO m => a -> m (MVar a) Source #

Lifted newMVar.

Since: unliftio-0.1.0.0

takeMVar :: MonadIO m => MVar a -> m a Source #

Lifted takeMVar.

Since: unliftio-0.1.0.0

putMVar :: MonadIO m => MVar a -> a -> m () Source #

Lifted putMVar.

Since: unliftio-0.1.0.0

readMVar :: MonadIO m => MVar a -> m a Source #

Lifted readMVar.

Since: unliftio-0.1.0.0

swapMVar :: MonadIO m => MVar a -> a -> m a Source #

Lifted swapMVar.

Since: unliftio-0.1.0.0

tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a) Source #

Lifted tryTakeMVar.

Since: unliftio-0.1.0.0

tryPutMVar :: MonadIO m => MVar a -> a -> m Bool Source #

Lifted tryPutMVar.

Since: unliftio-0.1.0.0

isEmptyMVar :: MonadIO m => MVar a -> m Bool Source #

Lifted isEmptyMVar.

Since: unliftio-0.1.0.0

withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b Source #

Unlifted withMVar.

Since: unliftio-0.1.0.0

withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b Source #

Unlifted withMVarMasked.

Since: unliftio-0.1.0.0

modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #

Unlifted modifyMVar.

Since: unliftio-0.1.0.0

modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #

Unlifted modifyMVar_.

Since: unliftio-0.1.0.0

modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #

Unlifted modifyMVarMasked.

Since: unliftio-0.1.0.0

modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #

Unlifted modifyMVarMasked_.

Since: unliftio-0.1.0.0

tryReadMVar :: MonadIO m => MVar a -> m (Maybe a) Source #

Lifted tryReadMVar.

Since: unliftio-0.1.0.0

mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a)) Source #

Unlifted mkWeakMVar.

Since: unliftio-0.1.0.0