strict-mvar-1.4.0.0: Strict MVars for IO and IOSim
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Concurrent.Class.MonadMVar.Strict

Description

This module corresponds to Control.Concurrent.MVar in the base package.

Synopsis

StrictMVar

type LazyMVar m = MVar m Source #

toLazyMVar :: StrictMVar m a -> LazyMVar m a Source #

Get the underlying MVar

Since we obviously cannot guarantee that updates to this LazyMVar will be strict, this should be used with caution.

fromLazyMVar :: MVar m a -> StrictMVar m a Source #

Create a StrictMVar from a LazyMVar

It is not guaranteed that the LazyMVar contains a value that is in WHNF, so there is no guarantee that the resulting StrictMVar contains a value that is in WHNF. This should be used with caution.

newMVar :: MonadMVar m => a -> m (StrictMVar m a) Source #

takeMVar :: MonadMVar m => StrictMVar m a -> m a Source #

putMVar :: MonadMVar m => StrictMVar m a -> a -> m () Source #

readMVar :: MonadMVar m => StrictMVar m a -> m a Source #

swapMVar :: MonadMVar m => StrictMVar m a -> a -> m a Source #

tryPutMVar :: MonadMVar m => StrictMVar m a -> a -> m Bool Source #

withMVar :: MonadMVar m => StrictMVar m a -> (a -> m b) -> m b Source #

withMVarMasked :: MonadMVar m => StrictMVar m a -> (a -> m b) -> m b Source #

modifyMVar_ :: MonadMVar m => StrictMVar m a -> (a -> m a) -> m () Source #

modifyMVar :: MonadMVar m => StrictMVar m a -> (a -> m (a, b)) -> m b Source #

modifyMVarMasked_ :: MonadMVar m => StrictMVar m a -> (a -> m a) -> m () Source #

modifyMVarMasked :: MonadMVar m => StrictMVar m a -> (a -> m (a, b)) -> m b Source #

Re-exports

class Monad m => MonadMVar (m :: Type -> Type) #

Instances

Instances details
MonadMVar IO 
Instance details

Defined in Control.Concurrent.Class.MonadMVar

Associated Types

type MVar IO :: Type -> Type #

Methods

newEmptyMVar :: IO (MVar IO a) #

takeMVar :: MVar IO a -> IO a #

putMVar :: MVar IO a -> a -> IO () #

tryTakeMVar :: MVar IO a -> IO (Maybe a) #

tryPutMVar :: MVar IO a -> a -> IO Bool #

isEmptyMVar :: MVar IO a -> IO Bool #

newMVar :: a -> IO (MVar IO a) #

readMVar :: MVar IO a -> IO a #

tryReadMVar :: MVar IO a -> IO (Maybe a) #

swapMVar :: MVar IO a -> a -> IO a #

withMVar :: MVar IO a -> (a -> IO b) -> IO b #

withMVarMasked :: MVar IO a -> (a -> IO b) -> IO b #

modifyMVar_ :: MVar IO a -> (a -> IO a) -> IO () #

modifyMVar :: MVar IO a -> (a -> IO (a, b)) -> IO b #

modifyMVarMasked_ :: MVar IO a -> (a -> IO a) -> IO () #

modifyMVarMasked :: MVar IO a -> (a -> IO (a, b)) -> IO b #

(MonadMask m, MonadMVar m) => MonadMVar (ReaderT r m) 
Instance details

Defined in Control.Concurrent.Class.MonadMVar

Associated Types

type MVar (ReaderT r m) :: Type -> Type #

Methods

newEmptyMVar :: ReaderT r m (MVar (ReaderT r m) a) #

takeMVar :: MVar (ReaderT r m) a -> ReaderT r m a #

putMVar :: MVar (ReaderT r m) a -> a -> ReaderT r m () #

tryTakeMVar :: MVar (ReaderT r m) a -> ReaderT r m (Maybe a) #

tryPutMVar :: MVar (ReaderT r m) a -> a -> ReaderT r m Bool #

isEmptyMVar :: MVar (ReaderT r m) a -> ReaderT r m Bool #

newMVar :: a -> ReaderT r m (MVar (ReaderT r m) a) #

readMVar :: MVar (ReaderT r m) a -> ReaderT r m a #

tryReadMVar :: MVar (ReaderT r m) a -> ReaderT r m (Maybe a) #

swapMVar :: MVar (ReaderT r m) a -> a -> ReaderT r m a #

withMVar :: MVar (ReaderT r m) a -> (a -> ReaderT r m b) -> ReaderT r m b #

withMVarMasked :: MVar (ReaderT r m) a -> (a -> ReaderT r m b) -> ReaderT r m b #

modifyMVar_ :: MVar (ReaderT r m) a -> (a -> ReaderT r m a) -> ReaderT r m () #

modifyMVar :: MVar (ReaderT r m) a -> (a -> ReaderT r m (a, b)) -> ReaderT r m b #

modifyMVarMasked_ :: MVar (ReaderT r m) a -> (a -> ReaderT r m a) -> ReaderT r m () #

modifyMVarMasked :: MVar (ReaderT r m) a -> (a -> ReaderT r m (a, b)) -> ReaderT r m b #