| Copyright | (c) 2016 Michael Walker | 
|---|---|
| License | MIT | 
| Maintainer | Michael Walker <mike@barrucadu.co.uk> | 
| Stability | stable | 
| Portability | portable | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Control.Concurrent.Classy.STM.TMVar
Contents
Description
Transactional MVars, for use with MonadSTM.
Deviations: TMVar as defined here does not have an Eq
 instance, this is because the MonadSTM TVar type does not have
 an Eq constraint. Furthermore, the newTMVarIO,
 newEmptyTMVarIO, and mkWeakTMVar functions are not provided.
Synopsis
- data TMVar stm a
- newTMVar :: MonadSTM stm => a -> stm (TMVar stm a)
- newTMVarN :: MonadSTM stm => String -> a -> stm (TMVar stm a)
- newEmptyTMVar :: MonadSTM stm => stm (TMVar stm a)
- newEmptyTMVarN :: MonadSTM stm => String -> stm (TMVar stm a)
- takeTMVar :: MonadSTM stm => TMVar stm a -> stm a
- putTMVar :: MonadSTM stm => TMVar stm a -> a -> stm ()
- readTMVar :: MonadSTM stm => TMVar stm a -> stm a
- tryTakeTMVar :: MonadSTM stm => TMVar stm a -> stm (Maybe a)
- tryPutTMVar :: MonadSTM stm => TMVar stm a -> a -> stm Bool
- tryReadTMVar :: MonadSTM stm => TMVar stm a -> stm (Maybe a)
- isEmptyTMVar :: MonadSTM stm => TMVar stm a -> stm Bool
- swapTMVar :: MonadSTM stm => TMVar stm a -> a -> stm a
TMVars
A TMVar is like an MVar or a mVar, but using transactional
 memory. As transactions are atomic, this makes dealing with
 multiple TMVars easier than wrangling multiple mVars.
Since: 1.0.0.0
newTMVar :: MonadSTM stm => a -> stm (TMVar stm a) Source #
Create a TMVar containing the given value.
Since: 1.0.0.0