Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module corresponds to Control.Concurrent.MVar in the base
package.
Synopsis
- data StrictMVar m a
- type LazyMVar m = MVar m
- castStrictMVar :: LazyMVar m ~ LazyMVar n => StrictMVar m a -> StrictMVar n a
- toLazyMVar :: StrictMVar m a -> LazyMVar m a
- fromLazyMVar :: MVar m a -> StrictMVar m a
- newEmptyMVar :: MonadMVar m => m (StrictMVar m a)
- newMVar :: MonadMVar m => a -> m (StrictMVar m a)
- takeMVar :: MonadMVar m => StrictMVar m a -> m a
- putMVar :: MonadMVar m => StrictMVar m a -> a -> m ()
- readMVar :: MonadMVar m => StrictMVar m a -> m a
- swapMVar :: MonadMVar m => StrictMVar m a -> a -> m a
- tryTakeMVar :: MonadMVar m => StrictMVar m a -> m (Maybe a)
- tryPutMVar :: MonadMVar m => StrictMVar m a -> a -> m Bool
- isEmptyMVar :: MonadMVar m => StrictMVar m a -> m Bool
- withMVar :: MonadMVar m => StrictMVar m a -> (a -> m b) -> m b
- withMVarMasked :: MonadMVar m => StrictMVar m a -> (a -> m b) -> m b
- modifyMVar_ :: MonadMVar m => StrictMVar m a -> (a -> m a) -> m ()
- modifyMVar :: MonadMVar m => StrictMVar m a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MonadMVar m => StrictMVar m a -> (a -> m a) -> m ()
- modifyMVarMasked :: MonadMVar m => StrictMVar m a -> (a -> m (a, b)) -> m b
- tryReadMVar :: MonadMVar m => StrictMVar m a -> m (Maybe a)
- class Monad m => MonadMVar (m :: Type -> Type)
StrictMVar
data StrictMVar m a Source #
castStrictMVar :: LazyMVar m ~ LazyMVar n => StrictMVar m a -> StrictMVar n a 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.
newEmptyMVar :: MonadMVar m => m (StrictMVar m a) Source #
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 #
tryTakeMVar :: MonadMVar m => StrictMVar m a -> m (Maybe a) Source #
tryPutMVar :: MonadMVar m => StrictMVar m a -> a -> m Bool Source #
isEmptyMVar :: MonadMVar m => StrictMVar m 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 #
tryReadMVar :: MonadMVar m => StrictMVar m a -> m (Maybe a) Source #
Re-exports
class Monad m => MonadMVar (m :: Type -> Type) #