Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => MonadMVar (m :: Type -> Type) where
- type MVar (m :: Type -> Type) :: Type -> Type
- newEmptyMVar :: m (MVar m a)
- takeMVar :: MVar m a -> m a
- putMVar :: MVar m a -> a -> m ()
- tryTakeMVar :: MVar m a -> m (Maybe a)
- tryPutMVar :: MVar m a -> a -> m Bool
- isEmptyMVar :: MVar m a -> m Bool
- newMVar :: a -> m (MVar m a)
- readMVar :: MVar m a -> m a
- tryReadMVar :: MVar m a -> m (Maybe a)
- swapMVar :: MVar m a -> a -> m a
- withMVar :: MVar m a -> (a -> m b) -> m b
- withMVarMasked :: MVar m a -> (a -> m b) -> m b
- modifyMVar_ :: MVar m a -> (a -> m a) -> m ()
- modifyMVar :: MVar m a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MVar m a -> (a -> m a) -> m ()
- modifyMVarMasked :: MVar m a -> (a -> m (a, b)) -> m b
- class (MonadMVar m, Monad (InspectMVarMonad m)) => MonadInspectMVar (m :: Type -> Type) where
- type InspectMVarMonad (m :: Type -> Type) :: Type -> Type
- inspectMVar :: proxy m -> MVar m a -> InspectMVarMonad m (Maybe a)
- class MonadMVar m => MonadLabelledMVar (m :: Type -> Type) where
Documentation
class Monad m => MonadMVar (m :: Type -> Type) where Source #
newEmptyMVar :: m (MVar m a) Source #
See newEmptyMVar
.
takeMVar :: MVar m a -> m a Source #
See takeMVar
.
putMVar :: MVar m a -> a -> m () Source #
See putMVar
.
tryTakeMVar :: MVar m a -> m (Maybe a) Source #
See tryTakeMVar
.
tryPutMVar :: MVar m a -> a -> m Bool Source #
See tryPutMVar
.
isEmptyMVar :: MVar m a -> m Bool Source #
See isEmptyMVar
.
newMVar :: a -> m (MVar m a) Source #
See newMVar
.
readMVar :: MVar m a -> m a Source #
See readMVar
.
tryReadMVar :: MVar m a -> m (Maybe a) Source #
See tryReadMVar
.
swapMVar :: MVar m a -> a -> m a Source #
See swapMVar
.
withMVar :: MVar m a -> (a -> m b) -> m b Source #
See withMVar
.
withMVarMasked :: MVar m a -> (a -> m b) -> m b Source #
See withMVarMasked
.
default withMVarMasked :: MonadMask m => MVar m a -> (a -> m b) -> m b Source #
modifyMVar_ :: MVar m a -> (a -> m a) -> m () Source #
See modifyMVar_
.
default modifyMVar_ :: MonadMask m => MVar m a -> (a -> m a) -> m () Source #
modifyMVar :: MVar m a -> (a -> m (a, b)) -> m b Source #
See modifyMVar
.
default modifyMVar :: (MonadMask m, MonadEvaluate m) => MVar m a -> (a -> m (a, b)) -> m b Source #
modifyMVarMasked_ :: MVar m a -> (a -> m a) -> m () Source #
See modifyMVarMasked_
.
default modifyMVarMasked_ :: MonadMask m => MVar m a -> (a -> m a) -> m () Source #
modifyMVarMasked :: MVar m a -> (a -> m (a, b)) -> m b Source #
See modifyMVarMasked
.
default modifyMVarMasked :: (MonadMask m, MonadEvaluate m) => MVar m a -> (a -> m (a, b)) -> m b Source #
Instances
non-standard extensions
class (MonadMVar m, Monad (InspectMVarMonad m)) => MonadInspectMVar (m :: Type -> Type) where Source #
This type class is intended for
'io-sim', where one might want
to access an MVar
in the underlying ST
monad.
inspectMVar :: proxy m -> MVar m a -> InspectMVarMonad m (Maybe a) Source #
Return the value of an MVar
as an InspectMVarMonad
computation. Can
be Nothing
if the MVar
is empty.
Instances
MonadInspectMVar IO Source # | |||||
Defined in Control.Concurrent.Class.MonadMVar
inspectMVar :: proxy IO -> MVar IO a -> InspectMVarMonad IO (Maybe a) Source # |