io-classes-1.6.0.0: Type classes for concurrency with STM, ST and timing
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Concurrent.Class.MonadSTM.Strict.TVar

Description

This module corresponds to TVar in "stm" package

Synopsis

StrictTVar

type LazyTVar m = TVar m Source #

toLazyTVar :: StrictTVar m a -> LazyTVar m a Source #

Get the underlying TVar

Since we obviously cannot guarantee that updates to this LazyTVar will be strict, this should be used with caution.

castStrictTVar :: LazyTVar m ~ LazyTVar n => StrictTVar m a -> StrictTVar n a Source #

Cast the monad if both use the same representation of TVars.

This function is useful for monad transformers stacks if the TVar is used in different monad stacks.

newTVar :: MonadSTM m => a -> STM m (StrictTVar m a) Source #

newTVarIO :: MonadSTM m => a -> m (StrictTVar m a) Source #

readTVar :: MonadSTM m => StrictTVar m a -> STM m a Source #

writeTVar :: MonadSTM m => StrictTVar m a -> a -> STM m () Source #

modifyTVar :: MonadSTM m => StrictTVar m a -> (a -> a) -> STM m () Source #

stateTVar :: MonadSTM m => StrictTVar m s -> (s -> (a, s)) -> STM m a Source #

swapTVar :: MonadSTM m => StrictTVar m a -> a -> STM m a Source #

check :: MonadSTM m => Bool -> STM m () #

MonadLabelSTM

MonadTraceSTM

traceTVar :: MonadTraceSTM m => proxy m -> StrictTVar m a -> (Maybe a -> a -> InspectMonad m TraceValue) -> STM m () Source #