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

CopyrightBas van Dijk
LicenseBSD-style
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell98

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

Eq (MVar a) 

Methods

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

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

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 a Source #

Generalized version of takeMVar.

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

Generalized version of putMVar.

readMVar :: MonadBase IO m => MVar a -> m a Source #

Generalized version of readMVar.

swapMVar :: MonadBase IO m => MVar a -> a -> m a Source #

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 Bool Source #

Generalized version of tryPutMVar.

isEmptyMVar :: MonadBase IO m => MVar a -> m Bool Source #

Generalized version of isEmptyMVar.

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

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 b Source #

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 b Source #

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.

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

Generalized version of withMVarMasked.

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

Generalized version of tryReadMVar.