lifted-base-0.2.3.0: lifted IO operations from the base library

Stabilityexperimental
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Safe HaskellTrustworthy

Control.Concurrent.MVar.Lifted

Description

This is a wrapped version of Control.Concurrent.MVar with types generalized from IO to all monads in either MonadBase or MonadBaseControl.

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

newEmptyMVar :: MonadBase IO m => m (MVar a)Source

Generalized version of newEmptyMVar.

newMVar :: MonadBase IO m => a -> m (MVar a)Source

Generalized version of newMVar.

takeMVar :: MonadBase IO m => MVar a -> m aSource

Generalized version of takeMVar.

putMVar :: MonadBase IO m => MVar a -> a -> m ()Source

Generalized version of putMVar.

readMVar :: MonadBase IO m => MVar a -> m aSource

Generalized version of readMVar.

swapMVar :: MonadBase IO m => MVar a -> a -> m aSource

Generalized version of swapMVar.

tryTakeMVar :: MonadBase IO m => MVar a -> m (Maybe a)Source

Generalized version of tryTakeMVar.

tryPutMVar :: MonadBase IO m => MVar a -> a -> m BoolSource

Generalized version of tryPutMVar.

isEmptyMVar :: MonadBase IO m => MVar a -> m BoolSource

Generalized version of isEmptyMVar.

withMVar :: MonadBaseControl IO m => MVar a -> (a -> m b) -> m bSource

Generalized version of withMVar.

modifyMVar_ :: MonadBaseControl IO m => MVar a -> (a -> m a) -> m ()Source

Generalized version of modifyMVar_.

modifyMVar :: MonadBaseControl IO m => MVar a -> (a -> m (a, b)) -> m bSource

Generalized version of modifyMVar.

modifyMVarMasked_ :: MonadBaseControl IO m => MVar a -> (a -> m a) -> m ()Source

Generalized version of modifyMVarMasked_.

modifyMVarMasked :: MonadBaseControl IO m => MVar a -> (a -> m (a, b)) -> m bSource

Generalized version of modifyMVarMasked.

mkWeakMVar :: MonadBaseControl IO m => MVar a -> m () -> m (Weak (MVar a))Source

Generalized version of mkWeakMVar.

Note any monadic side effects in m of the "finalizer" computation are discarded.