Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module corresponds to TMVar
in "stm" package
Synopsis
- data StrictTMVar m a
- type LazyTMVar m = TMVar m
- toLazyTMVar :: StrictTMVar m a -> LazyTMVar m a
- fromLazyTMVar :: LazyTMVar m a -> StrictTMVar m a
- castStrictTMVar :: LazyTMVar m ~ LazyTMVar n => StrictTMVar m a -> StrictTMVar n a
- newTMVar :: MonadSTM m => a -> STM m (StrictTMVar m a)
- newEmptyTMVar :: MonadSTM m => STM m (StrictTMVar m a)
- newTMVarIO :: MonadSTM m => a -> m (StrictTMVar m a)
- newEmptyTMVarIO :: MonadSTM m => m (StrictTMVar m a)
- takeTMVar :: MonadSTM m => StrictTMVar m a -> STM m a
- tryTakeTMVar :: MonadSTM m => StrictTMVar m a -> STM m (Maybe a)
- putTMVar :: MonadSTM m => StrictTMVar m a -> a -> STM m ()
- tryPutTMVar :: MonadSTM m => StrictTMVar m a -> a -> STM m Bool
- readTMVar :: MonadSTM m => StrictTMVar m a -> STM m a
- tryReadTMVar :: MonadSTM m => StrictTMVar m a -> STM m (Maybe a)
- swapTMVar :: MonadSTM m => StrictTMVar m a -> a -> STM m a
- isEmptyTMVar :: MonadSTM m => StrictTMVar m a -> STM m Bool
- newTMVarM :: MonadSTM m => a -> m (StrictTMVar m a)
- newEmptyTMVarM :: MonadSTM m => m (StrictTMVar m a)
- labelTMVar :: MonadLabelledSTM m => StrictTMVar m a -> String -> STM m ()
- labelTMVarIO :: MonadLabelledSTM m => StrictTMVar m a -> String -> m ()
- traceTMVar :: MonadTraceSTM m => proxy m -> StrictTMVar m a -> (Maybe (Maybe a) -> Maybe a -> InspectMonad m TraceValue) -> STM m ()
- traceTMVarIO :: MonadTraceSTM m => StrictTMVar m a -> (Maybe (Maybe a) -> Maybe a -> InspectMonad m TraceValue) -> m ()
StrictTMVar
data StrictTMVar m a Source #
TMVar
that keeps its value in WHNF at all times
Does not support an invariant: if the invariant would not be satisfied, we would not be able to put a value into an empty TMVar, which would lead to very hard to debug bugs where code is blocked indefinitely.
toLazyTMVar :: StrictTMVar m a -> LazyTMVar m a Source #
fromLazyTMVar :: LazyTMVar m a -> StrictTMVar m a Source #
castStrictTMVar :: LazyTMVar m ~ LazyTMVar n => StrictTMVar m a -> StrictTMVar n a Source #
newEmptyTMVar :: MonadSTM m => STM m (StrictTMVar m a) Source #
newTMVarIO :: MonadSTM m => a -> m (StrictTMVar m a) Source #
newEmptyTMVarIO :: MonadSTM m => m (StrictTMVar m a) Source #
tryTakeTMVar :: MonadSTM m => StrictTMVar m a -> STM m (Maybe a) Source #
tryPutTMVar :: MonadSTM m => StrictTMVar m a -> a -> STM m Bool Source #
tryReadTMVar :: MonadSTM m => StrictTMVar m a -> STM m (Maybe a) Source #
isEmptyTMVar :: MonadSTM m => StrictTMVar m a -> STM m Bool Source #
deprecated api
newTMVarM :: MonadSTM m => a -> m (StrictTMVar m a) Source #
Deprecated: Use newTVarIO
newEmptyTMVarM :: MonadSTM m => m (StrictTMVar m a) Source #
Deprecated: Use newEmptyTMVarIO
MonadLabelledSTM
labelTMVar :: MonadLabelledSTM m => StrictTMVar m a -> String -> STM m () Source #
labelTMVarIO :: MonadLabelledSTM m => StrictTMVar m a -> String -> m () Source #
MonadTraceSTM
traceTMVar :: MonadTraceSTM m => proxy m -> StrictTMVar m a -> (Maybe (Maybe a) -> Maybe a -> InspectMonad m TraceValue) -> STM m () Source #
traceTMVarIO :: MonadTraceSTM m => StrictTMVar m a -> (Maybe (Maybe a) -> Maybe a -> InspectMonad m TraceValue) -> m () Source #