unliftio-0.2.13: The MonadUnliftIO typeclass for unlifting monads to IO (batteries included)

Safe Haskell | Safe
Language | Haskell2010

UnliftIO.MVar

Description

Unlifted Control.Concurrent.MVar.

Since: 0.1.0.0

Synopsis

- data MVar a
- newEmptyMVar :: MonadIO m => m (MVar a)
- newMVar :: MonadIO m => a -> m (MVar a)
- takeMVar :: MonadIO m => MVar a -> m a
- putMVar :: MonadIO m => MVar a -> a -> m ()
- readMVar :: MonadIO m => MVar a -> m a
- swapMVar :: MonadIO m => MVar a -> a -> m a
- tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- isEmptyMVar :: MonadIO m => MVar a -> m Bool
- withMVar :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- withMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m b) -> m b
- modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b
- modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m ()
- tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a))

# Documentation

data MVar a #

#### Instances

Instances details

NFData1 MVar |
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> MVar a -> ()
Eq (MVar a) |
Instance details Defined in GHC.MVar Methods (==) :: MVar a -> MVar a -> Bool (/=) :: MVar a -> MVar a -> Bool
NFData (MVar a) |
Instance details Defined in Control.DeepSeq Methods rnf :: MVar a -> ()

newEmptyMVar :: MonadIO m => m (MVar a) Source #

Lifted `newEmptyMVar`.

Since: 0.1.0.0

newMVar :: MonadIO m => a -> m (MVar a) Source #

Lifted `newMVar`.

Since: 0.1.0.0

takeMVar :: MonadIO m => MVar a -> m a Source #

Lifted `takeMVar`.

Since: 0.1.0.0

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

Lifted `putMVar`.

Since: 0.1.0.0

readMVar :: MonadIO m => MVar a -> m a Source #

Lifted `readMVar`.

Since: 0.1.0.0

swapMVar :: MonadIO m => MVar a -> a -> m a Source #

Lifted `swapMVar`.

Since: 0.1.0.0

tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a) Source #

Lifted `tryTakeMVar`.

Since: 0.1.0.0

tryPutMVar :: MonadIO m => MVar a -> a -> m Bool Source #

Lifted `tryPutMVar`.

Since: 0.1.0.0

isEmptyMVar :: MonadIO m => MVar a -> m Bool Source #

Lifted `isEmptyMVar`.

Since: 0.1.0.0

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

Unlifted `withMVar`.

Since: 0.1.0.0

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

Unlifted `withMVarMasked`.

Since: 0.1.0.0

modifyMVar :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #

Unlifted `modifyMVar`.

Since: 0.1.0.0

modifyMVar_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #

Unlifted `modifyMVar_`.

Since: 0.1.0.0

modifyMVarMasked :: MonadUnliftIO m => MVar a -> (a -> m (a, b)) -> m b Source #

Unlifted `modifyMVarMasked`.

Since: 0.1.0.0

modifyMVarMasked_ :: MonadUnliftIO m => MVar a -> (a -> m a) -> m () Source #

Unlifted `modifyMVarMasked_`.

Since: 0.1.0.0

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

Lifted `tryReadMVar`.

Since: 0.1.0.0

mkWeakMVar :: MonadUnliftIO m => MVar a -> m () -> m (Weak (MVar a)) Source #

Unlifted `mkWeakMVar`.

Since: 0.1.0.0