Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module corresponds to TVar
in "stm" package
Synopsis
- data StrictTVar (m :: Type -> Type) a
- type LazyTVar (m :: Type -> Type) = TVar m
- toLazyTVar :: forall (m :: Type -> Type) a. StrictTVar m a -> LazyTVar m a
- fromLazyTVar :: forall (m :: Type -> Type) a. LazyTVar m a -> StrictTVar m a
- castStrictTVar :: forall (m :: Type -> Type) (n :: Type -> Type) a. LazyTVar m ~ LazyTVar n => StrictTVar m a -> StrictTVar n a
- newTVar :: forall (m :: Type -> Type) a. MonadSTM m => a -> STM m (StrictTVar m a)
- newTVarIO :: MonadSTM m => a -> m (StrictTVar m a)
- readTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> STM m a
- readTVarIO :: MonadSTM m => StrictTVar m a -> m a
- writeTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> a -> STM m ()
- modifyTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> (a -> a) -> STM m ()
- stateTVar :: forall (m :: Type -> Type) s a. MonadSTM m => StrictTVar m s -> (s -> (a, s)) -> STM m a
- swapTVar :: forall (m :: Type -> Type) a. MonadSTM m => StrictTVar m a -> a -> STM m a
- check :: MonadSTM m => Bool -> STM m ()
- labelTVar :: forall (m :: Type -> Type) a. MonadLabelledSTM m => StrictTVar m a -> String -> STM m ()
- labelTVarIO :: MonadLabelledSTM m => StrictTVar m a -> String -> m ()
- traceTVar :: forall (m :: Type -> Type) proxy a. MonadTraceSTM m => proxy m -> StrictTVar m a -> (Maybe a -> a -> InspectMonad m TraceValue) -> STM m ()
- traceTVarIO :: MonadTraceSTM m => StrictTVar m a -> (Maybe a -> a -> InspectMonad m TraceValue) -> m ()
- debugTraceTVar :: forall (m :: Type -> Type) a proxy. (MonadTraceSTM m, Show a) => proxy m -> StrictTVar m a -> STM m ()
- debugTraceTVarIO :: (MonadTraceSTM m, Show a) => StrictTVar m a -> m ()
StrictTVar
data StrictTVar (m :: Type -> Type) a 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 TVar
s.
This function is useful for monad transformers stacks if the TVar
is used
in different monad stacks.
newTVarIO :: MonadSTM m => a -> m (StrictTVar m a) Source #
readTVarIO :: MonadSTM m => StrictTVar m a -> m a 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 #
MonadLabelSTM
labelTVar :: forall (m :: Type -> Type) a. MonadLabelledSTM m => StrictTVar m a -> String -> STM m () Source #
labelTVarIO :: MonadLabelledSTM m => StrictTVar m a -> String -> 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 #
traceTVarIO :: MonadTraceSTM m => StrictTVar m a -> (Maybe a -> a -> InspectMonad m TraceValue) -> m () Source #
debugTraceTVar :: forall (m :: Type -> Type) a proxy. (MonadTraceSTM m, Show a) => proxy m -> StrictTVar m a -> STM m () Source #
debugTraceTVarIO :: (MonadTraceSTM m, Show a) => StrictTVar m a -> m () Source #