io-classes:strict-stm
Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.Class.MonadSTM.Strict.TVar

Description

This module corresponds to TVar in "stm" package

Synopsis

StrictTVar

data StrictTVar (m :: Type -> Type) a Source #

type LazyTVar (m :: Type -> Type) = TVar m Source #

toLazyTVar :: forall (m :: Type -> Type) a. 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.

fromLazyTVar :: forall (m :: Type -> Type) a. LazyTVar m a -> StrictTVar m a Source #

castStrictTVar :: forall (m :: Type -> Type) (n :: Type -> Type) a. 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 :: forall (m :: Type -> Type) a. MonadSTM m => a -> STM m (StrictTVar m a) Source #

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

readTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> STM m a Source #

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

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

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

swapTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> a -> STM m a Source #

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

See check.

MonadLabelSTM

labelTVar :: forall (m :: Type -> Type) a. MonadLabelledSTM m => StrictTVar m a -> String -> STM m () Source #

MonadTraceSTM

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

debugTraceTVar :: forall (m :: Type -> Type) a proxy. (MonadTraceSTM m, Show a) => proxy m -> StrictTVar m a -> STM m () Source #