Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- catchSTM :: forall (m :: Type -> Type ) e a. ( MonadSTM m, MonadCatch ( STM m), Exception e) => STM m a -> (e -> STM m a) -> STM m a
- throwSTM :: forall (m :: Type -> Type ) e a. ( MonadSTM m, MonadThrow ( STM m), Exception e) => e -> STM m a
- flushTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m [a]
- lengthTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Natural
- isFullTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Bool
- isEmptyTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Bool
- writeTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> a -> STM m ()
- tryPeekTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m ( Maybe a)
- peekTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m a
- tryReadTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m ( Maybe a)
- readTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m a
- newTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => Natural -> STM m ( TBQueueDefault m a)
- labelTBQueueDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TBQueueDefault m a -> String -> STM m ()
- tryPeekTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m ( Maybe a)
- peekTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m a
- isEmptyTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m Bool
- tryReadTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m ( Maybe a)
- readTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m a
- writeTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> a -> STM m ()
- newTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => STM m ( TQueueDefault m a)
- labelTQueueDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TQueueDefault m a -> String -> STM m ()
- isEmptyTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m Bool
- swapTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m a
- tryReadTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m ( Maybe a)
- readTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m a
- tryPutTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m Bool
- putTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m ()
- tryTakeTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m ( Maybe a)
- takeTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m a
- newEmptyTMVarMDefault :: MonadSTM m => m ( TMVarDefault m a)
- newEmptyTMVarIODefault :: MonadSTM m => m ( TMVarDefault m a)
- newEmptyTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => STM m ( TMVarDefault m a)
- newTMVarMDefault :: MonadSTM m => a -> m ( TMVarDefault m a)
- newTMVarIODefault :: MonadSTM m => a -> m ( TMVarDefault m a)
- newTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => a -> STM m ( TMVarDefault m a)
- traceTMVarDefault :: forall (m :: Type -> Type ) proxy a. MonadTraceSTM m => proxy m -> TMVarDefault m a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad m TraceValue ) -> STM m ()
- labelTMVarDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TMVarDefault m a -> String -> STM m ()
- type family TBQueue (m :: Type -> Type ) :: Type -> Type
- type family TQueue (m :: Type -> Type ) :: Type -> Type
- type family STM (m :: Type -> Type ) = (stm :: Type -> Type ) | stm -> m
-
class
(
Monad
m,
Alternative
(
STM
m),
MonadPlus
(
STM
m)) =>
MonadSTM
(m ::
Type
->
Type
)
where
- type STM (m :: Type -> Type ) = (stm :: Type -> Type ) | stm -> m
- type TQueue (m :: Type -> Type ) :: Type -> Type
- type TBQueue (m :: Type -> Type ) :: Type -> Type
- atomically :: HasCallStack => STM m a -> m a
- retry :: STM m a
- orElse :: STM m a -> STM m a -> STM m a
- modifyTVar' :: TVar m a -> (a -> a) -> STM m ()
- check :: Bool -> STM m ()
- newTQueue :: STM m ( TQueue m a)
- readTQueue :: TQueue m a -> STM m a
- tryReadTQueue :: TQueue m a -> STM m ( Maybe a)
- peekTQueue :: TQueue m a -> STM m a
- tryPeekTQueue :: TQueue m a -> STM m ( Maybe a)
- writeTQueue :: TQueue m a -> a -> STM m ()
- isEmptyTQueue :: TQueue m a -> STM m Bool
- newTBQueue :: Natural -> STM m ( TBQueue m a)
- readTBQueue :: TBQueue m a -> STM m a
- tryReadTBQueue :: TBQueue m a -> STM m ( Maybe a)
- peekTBQueue :: TBQueue m a -> STM m a
- tryPeekTBQueue :: TBQueue m a -> STM m ( Maybe a)
- flushTBQueue :: TBQueue m a -> STM m [a]
- writeTBQueue :: TBQueue m a -> a -> STM m ()
- lengthTBQueue :: TBQueue m a -> STM m Natural
- isEmptyTBQueue :: TBQueue m a -> STM m Bool
- isFullTBQueue :: TBQueue m a -> STM m Bool
- newTQueueIO :: m ( TQueue m a)
- newTBQueueIO :: Natural -> m ( TBQueue m a)
-
class
MonadSTM
m =>
MonadLabelledSTM
(m ::
Type
->
Type
)
where
- labelTQueue :: TQueue m a -> String -> STM m ()
- labelTBQueue :: TBQueue m a -> String -> STM m ()
- labelTQueueIO :: TQueue m a -> String -> m ()
- labelTBQueueIO :: TBQueue m a -> String -> m ()
- type family InspectMonad (m :: Type -> Type ) :: Type -> Type
-
class
(
MonadSTM
m,
Monad
(
InspectMonad
m)) =>
MonadInspectSTM
(m ::
Type
->
Type
)
where
- type InspectMonad (m :: Type -> Type ) :: Type -> Type
- inspectTVar :: proxy m -> TVar m a -> InspectMonad m a
- inspectTMVar :: proxy m -> TMVar m a -> InspectMonad m ( Maybe a)
-
data
TraceValue
where
- TraceValue :: forall tr. Typeable tr => {..} -> TraceValue
- pattern TraceDynamic :: () => Typeable tr => tr -> TraceValue
- pattern TraceString :: String -> TraceValue
- pattern DontTrace :: TraceValue
-
class
MonadInspectSTM
m =>
MonadTraceSTM
(m ::
Type
->
Type
)
where
- traceTQueue :: proxy m -> TQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> STM m ()
- traceTBQueue :: proxy m -> TBQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> STM m ()
- traceTQueueIO :: proxy m -> TQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> m ()
- traceTBQueueIO :: proxy m -> TBQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> m ()
- data TMVarDefault (m :: Type -> Type ) a
- data TQueueDefault (m :: Type -> Type ) a = TQueue !( TVar m [a]) !( TVar m [a])
- data TBQueueDefault (m :: Type -> Type ) a = TBQueue !( TVar m Natural ) !( TVar m [a]) !( TVar m Natural ) !( TVar m [a]) ! Natural
-
newtype
WrappedSTM
(t :: Trans) r (m ::
Type
->
Type
) a =
WrappedSTM
{
- runWrappedSTM :: STM m a
- type LazyTVar m = TVar m
- type LazyTMVar m = TMVar m
- data StrictTVar m a
- labelTVar :: MonadLabelledSTM m => StrictTVar m a -> String -> STM m ()
- labelTVarIO :: MonadLabelledSTM m => StrictTVar m a -> String -> m ()
- traceTVar :: MonadTraceSTM m => proxy m -> StrictTVar m a -> ( Maybe a -> a -> InspectMonad m TraceValue ) -> STM m ()
- traceTVarIO :: MonadTraceSTM m => proxy m -> StrictTVar m a -> ( Maybe a -> a -> InspectMonad m TraceValue ) -> m ()
- castStrictTVar :: LazyTVar m ~ LazyTVar n => StrictTVar m a -> StrictTVar n a
- toLazyTVar :: StrictTVar m a -> LazyTVar m a
- fromLazyTVar :: LazyTVar m a -> StrictTVar m a
- newTVar :: MonadSTM m => a -> STM m ( StrictTVar m a)
- newTVarIO :: MonadSTM m => a -> m ( StrictTVar m a)
- newTVarWithInvariant :: ( MonadSTM m, HasCallStack ) => (a -> Maybe String ) -> a -> STM m ( StrictTVar m a)
- newTVarWithInvariantIO :: ( MonadSTM m, HasCallStack ) => (a -> Maybe String ) -> a -> m ( StrictTVar m a)
- readTVar :: MonadSTM m => StrictTVar m a -> STM m a
- readTVarIO :: MonadSTM m => StrictTVar m a -> m a
- writeTVar :: ( MonadSTM m, HasCallStack ) => StrictTVar m a -> a -> STM m ()
- modifyTVar :: MonadSTM m => StrictTVar m a -> (a -> a) -> STM m ()
- stateTVar :: MonadSTM m => StrictTVar m s -> (s -> (a, s)) -> STM m a
- swapTVar :: MonadSTM m => StrictTVar m a -> a -> STM m a
- data 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 => proxy m -> StrictTMVar m a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad m TraceValue ) -> m ()
- castStrictTMVar :: LazyTMVar m ~ LazyTMVar n => StrictTMVar m a -> StrictTMVar n a
- $sel:toLazyTMVar:StrictTMVar :: StrictTMVar m a -> LazyTMVar m a
- fromLazyTMVar :: LazyTMVar m a -> StrictTMVar m a
- newTMVar :: MonadSTM m => a -> STM m ( StrictTMVar m a)
- newTMVarIO :: MonadSTM m => a -> m ( StrictTMVar m a)
- newEmptyTMVar :: MonadSTM m => STM 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
- checkInvariant :: HasCallStack => Maybe String -> a -> a
- updateTVar :: MonadSTM m => StrictTVar m s -> (s -> (a, s)) -> STM m a
- newTVarM :: MonadSTM m => a -> m ( StrictTVar m a)
- newTVarWithInvariantM :: ( MonadSTM m, HasCallStack ) => (a -> Maybe String ) -> a -> m ( StrictTVar m a)
- newTMVarM :: MonadSTM m => a -> m ( StrictTMVar m a)
- newEmptyTMVarM :: MonadSTM m => m ( StrictTMVar m a)
Documentation
catchSTM :: forall (m :: Type -> Type ) e a. ( MonadSTM m, MonadCatch ( STM m), Exception e) => STM m a -> (e -> STM m a) -> STM m a Source #
catch
specialized for an
stm
monad.
throwSTM :: forall (m :: Type -> Type ) e a. ( MonadSTM m, MonadThrow ( STM m), Exception e) => e -> STM m a Source #
throwIO
specialised to
stm
monad.
flushTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m [a] Source #
lengthTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Natural Source #
isFullTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Bool Source #
isEmptyTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m Bool Source #
writeTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> a -> STM m () Source #
tryPeekTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m ( Maybe a) Source #
peekTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m a Source #
tryReadTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m ( Maybe a) Source #
readTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TBQueueDefault m a -> STM m a Source #
newTBQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => Natural -> STM m ( TBQueueDefault m a) Source #
labelTBQueueDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TBQueueDefault m a -> String -> STM m () Source #
tryPeekTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m ( Maybe a) Source #
peekTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m a Source #
isEmptyTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m Bool Source #
tryReadTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m ( Maybe a) Source #
readTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> STM m a Source #
writeTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TQueueDefault m a -> a -> STM m () Source #
newTQueueDefault :: forall (m :: Type -> Type ) a. MonadSTM m => STM m ( TQueueDefault m a) Source #
labelTQueueDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TQueueDefault m a -> String -> STM m () Source #
isEmptyTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m Bool Source #
swapTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m a Source #
tryReadTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m ( Maybe a) Source #
readTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m a Source #
tryPutTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m Bool Source #
putTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> a -> STM m () Source #
tryTakeTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m ( Maybe a) Source #
takeTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => TMVarDefault m a -> STM m a Source #
newEmptyTMVarMDefault :: MonadSTM m => m ( TMVarDefault m a) Source #
newEmptyTMVarIODefault :: MonadSTM m => m ( TMVarDefault m a) Source #
newEmptyTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => STM m ( TMVarDefault m a) Source #
newTMVarMDefault :: MonadSTM m => a -> m ( TMVarDefault m a) Source #
newTMVarIODefault :: MonadSTM m => a -> m ( TMVarDefault m a) Source #
newTMVarDefault :: forall (m :: Type -> Type ) a. MonadSTM m => a -> STM m ( TMVarDefault m a) Source #
traceTMVarDefault :: forall (m :: Type -> Type ) proxy a. MonadTraceSTM m => proxy m -> TMVarDefault m a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad m TraceValue ) -> STM m () Source #
labelTMVarDefault :: forall (m :: Type -> Type ) a. MonadLabelledSTM m => TMVarDefault m a -> String -> STM m () Source #
type family TBQueue (m :: Type -> Type ) :: Type -> Type Source #
Instances
type TBQueue IO | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( ExceptT e m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( ReaderT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( StateT s m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( WriterT w m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( ContT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TBQueue ( RWST r w s m) | |
Defined in Control.Monad.Class.MonadSTM |
type family TQueue (m :: Type -> Type ) :: Type -> Type Source #
Instances
type TQueue IO | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( ExceptT e m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( ReaderT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( StateT s m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( WriterT w m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( ContT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type TQueue ( RWST r w s m) | |
Defined in Control.Monad.Class.MonadSTM |
type family STM (m :: Type -> Type ) = (stm :: Type -> Type ) | stm -> m Source #
Instances
type STM IO | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( ExceptT e m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( ReaderT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( StateT s m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( WriterT w m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( ContT r m) | |
Defined in Control.Monad.Class.MonadSTM |
|
type STM ( RWST r w s m) | |
Defined in Control.Monad.Class.MonadSTM |
class ( Monad m, Alternative ( STM m), MonadPlus ( STM m)) => MonadSTM (m :: Type -> Type ) where Source #
atomically , newTVar , readTVar , writeTVar , retry , orElse , newTMVar , newEmptyTMVar , takeTMVar , tryTakeTMVar , putTMVar , tryPutTMVar , readTMVar , tryReadTMVar , swapTMVar , isEmptyTMVar , newTQueue , readTQueue , tryReadTQueue , peekTQueue , tryPeekTQueue , writeTQueue , isEmptyTQueue , newTBQueue , readTBQueue , tryReadTBQueue , peekTBQueue , tryPeekTBQueue , flushTBQueue , writeTBQueue , lengthTBQueue , isEmptyTBQueue , isFullTBQueue
type STM (m :: Type -> Type ) = (stm :: Type -> Type ) | stm -> m Source #
atomically :: HasCallStack => STM m a -> m a Source #
orElse :: STM m a -> STM m a -> STM m a Source #
modifyTVar' :: TVar m a -> (a -> a) -> STM m () Source #
check :: Bool -> STM m () Source #
newTQueue :: STM m ( TQueue m a) Source #
readTQueue :: TQueue m a -> STM m a Source #
tryReadTQueue :: TQueue m a -> STM m ( Maybe a) Source #
peekTQueue :: TQueue m a -> STM m a Source #
tryPeekTQueue :: TQueue m a -> STM m ( Maybe a) Source #
writeTQueue :: TQueue m a -> a -> STM m () Source #
isEmptyTQueue :: TQueue m a -> STM m Bool Source #
newTBQueue :: Natural -> STM m ( TBQueue m a) Source #
readTBQueue :: TBQueue m a -> STM m a Source #
tryReadTBQueue :: TBQueue m a -> STM m ( Maybe a) Source #
peekTBQueue :: TBQueue m a -> STM m a Source #
tryPeekTBQueue :: TBQueue m a -> STM m ( Maybe a) Source #
flushTBQueue :: TBQueue m a -> STM m [a] Source #
writeTBQueue :: TBQueue m a -> a -> STM m () Source #
lengthTBQueue :: TBQueue m a -> STM m Natural Source #
Since: io-classes-0.2.0.0
isEmptyTBQueue :: TBQueue m a -> STM m Bool Source #
isFullTBQueue :: TBQueue m a -> STM m Bool Source #
newTQueueIO :: m ( TQueue m a) Source #
newTBQueueIO :: Natural -> m ( TBQueue m a) Source #
Instances
class MonadSTM m => MonadLabelledSTM (m :: Type -> Type ) where Source #
labelTQueue :: TQueue m a -> String -> STM m () Source #
labelTBQueue :: TBQueue m a -> String -> STM m () Source #
labelTQueueIO :: TQueue m a -> String -> m () Source #
labelTBQueueIO :: TBQueue m a -> String -> m () Source #
Instances
MonadLabelledSTM IO |
noop instance |
Defined in Control.Monad.Class.MonadSTM labelTVar :: TVar IO a -> String -> STM IO () Source # labelTMVar :: TMVar IO a -> String -> STM IO () Source # labelTQueue :: TQueue IO a -> String -> STM IO () Source # labelTBQueue :: TBQueue IO a -> String -> STM IO () Source # labelTVarIO :: TVar IO a -> String -> IO () Source # labelTMVarIO :: TMVar IO a -> String -> IO () Source # |
type family InspectMonad (m :: Type -> Type ) :: Type -> Type Source #
Instances
type InspectMonad IO | |
Defined in Control.Monad.Class.MonadSTM |
class ( MonadSTM m, Monad ( InspectMonad m)) => MonadInspectSTM (m :: Type -> Type ) where Source #
This type class is indented for 'io-sim', where one might want to access
TVar
in the underlying
ST
monad.
inspectTVar :: proxy m -> TVar m a -> InspectMonad m a Source #
inspectTMVar :: proxy m -> TMVar m a -> InspectMonad m ( Maybe a) Source #
Instances
MonadInspectSTM IO | |
Defined in Control.Monad.Class.MonadSTM inspectTVar :: proxy IO -> TVar IO a -> InspectMonad IO a Source # inspectTMVar :: proxy IO -> TMVar IO a -> InspectMonad IO ( Maybe a) Source # |
data TraceValue where Source #
A GADT which instructs how to trace the value. The
traceDynamic
will
use dynamic tracing, e.g.
traceM
; while
traceString
will be traced with
EventSay
.
TraceValue | |
|
pattern TraceDynamic :: () => Typeable tr => tr -> TraceValue |
Use only dynamic tracer. |
pattern TraceString :: String -> TraceValue |
Use only string tracing. |
pattern DontTrace :: TraceValue |
Do not trace the value. |
class MonadInspectSTM m => MonadTraceSTM (m :: Type -> Type ) where Source #
MonadTraceSTM
allows to trace values of stm variables when stm
transaction is committed. This allows to verify invariants when a variable
is committed.
traceTQueue :: proxy m -> TQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> STM m () Source #
traceTBQueue :: proxy m -> TBQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> STM m () Source #
traceTQueueIO :: proxy m -> TQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> m () Source #
traceTBQueueIO :: proxy m -> TBQueue m a -> ( Maybe [a] -> [a] -> InspectMonad m TraceValue ) -> m () Source #
Instances
MonadTraceSTM IO |
noop instance |
Defined in Control.Monad.Class.MonadSTM traceTVar :: proxy IO -> TVar IO a -> ( Maybe a -> a -> InspectMonad IO TraceValue ) -> STM IO () Source # traceTMVar :: proxy IO -> TMVar IO a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad IO TraceValue ) -> STM IO () Source # traceTQueue :: proxy IO -> TQueue IO a -> ( Maybe [a] -> [a] -> InspectMonad IO TraceValue ) -> STM IO () Source # traceTBQueue :: proxy IO -> TBQueue IO a -> ( Maybe [a] -> [a] -> InspectMonad IO TraceValue ) -> STM IO () Source # traceTVarIO :: proxy IO -> TVar IO a -> ( Maybe a -> a -> InspectMonad IO TraceValue ) -> IO () Source # traceTMVarIO :: proxy IO -> TMVar IO a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad IO TraceValue ) -> IO () Source # traceTQueueIO :: proxy IO -> TQueue IO a -> ( Maybe [a] -> [a] -> InspectMonad IO TraceValue ) -> IO () Source # traceTBQueueIO :: proxy IO -> TBQueue IO a -> ( Maybe [a] -> [a] -> InspectMonad IO TraceValue ) -> IO () Source # |
data TMVarDefault (m :: Type -> Type ) a Source #
data TBQueueDefault (m :: Type -> Type ) a Source #
newtype WrappedSTM (t :: Trans) r (m :: Type -> Type ) a Source #
A newtype wrapper for an
STM
monad for monad transformers.
WrappedSTM | |
|
Instances
StrictTVar
data StrictTVar m a Source #
labelTVar :: MonadLabelledSTM m => StrictTVar m a -> String -> STM m () Source #
labelTVarIO :: MonadLabelledSTM m => StrictTVar m a -> String -> m () Source #
traceTVar :: MonadTraceSTM m => proxy m -> StrictTVar m a -> ( Maybe a -> a -> InspectMonad m TraceValue ) -> STM m () Source #
traceTVarIO :: MonadTraceSTM m => proxy m -> StrictTVar m a -> ( Maybe a -> a -> InspectMonad m TraceValue ) -> m () Source #
castStrictTVar :: LazyTVar m ~ LazyTVar n => StrictTVar m a -> StrictTVar n a 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.
fromLazyTVar :: LazyTVar m a -> StrictTVar m a Source #
newTVarIO :: MonadSTM m => a -> m ( StrictTVar m a) Source #
:: ( MonadSTM m, HasCallStack ) | |
=> (a -> Maybe String ) |
Invariant (expect
|
-> a | |
-> STM m ( StrictTVar m a) |
newTVarWithInvariantIO Source #
:: ( MonadSTM m, HasCallStack ) | |
=> (a -> Maybe String ) |
Invariant (expect
|
-> a | |
-> m ( StrictTVar m a) |
readTVarIO :: MonadSTM m => StrictTVar m a -> m a Source #
writeTVar :: ( MonadSTM m, HasCallStack ) => StrictTVar m a -> a -> STM m () Source #
modifyTVar :: MonadSTM m => StrictTVar m a -> (a -> a) -> STM m () Source #
StrictTMVar
data StrictTMVar m a Source #
labelTMVar :: MonadLabelledSTM m => StrictTMVar m a -> String -> STM m () Source #
labelTMVarIO :: MonadLabelledSTM m => StrictTMVar m a -> String -> m () Source #
traceTMVar :: MonadTraceSTM m => proxy m -> StrictTMVar m a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad m TraceValue ) -> STM m () Source #
traceTMVarIO :: MonadTraceSTM m => proxy m -> StrictTMVar m a -> ( Maybe ( Maybe a) -> Maybe a -> InspectMonad m TraceValue ) -> m () Source #
castStrictTMVar :: LazyTMVar m ~ LazyTMVar n => StrictTMVar m a -> StrictTMVar n a Source #
$sel:toLazyTMVar:StrictTMVar :: StrictTMVar m a -> LazyTMVar m a Source #
fromLazyTMVar :: LazyTMVar m a -> StrictTMVar m a Source #
newTMVarIO :: MonadSTM m => a -> m ( StrictTMVar m a) Source #
newEmptyTMVar :: MonadSTM m => STM 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 #
Low-level API
checkInvariant :: HasCallStack => Maybe String -> a -> a Source #
Check invariant (if enabled) before continuing
checkInvariant mErr x
is equal to
x
if
mErr == Nothing
, and throws
an error
err
if
mErr == Just err
.
This is exported so that other code that wants to conditionally check invariants can reuse the same logic, rather than having to introduce new per-package flags.
Deprecated API
updateTVar :: MonadSTM m => StrictTVar m s -> (s -> (a, s)) -> STM m a Source #
Deprecated: Use stateTVar
newTVarM :: MonadSTM m => a -> m ( StrictTVar m a) Source #
Deprecated: Use newTVarIO
newTVarWithInvariantM Source #
:: ( MonadSTM m, HasCallStack ) | |
=> (a -> Maybe String ) |
Invariant (expect
|
-> a | |
-> m ( StrictTVar m a) |
Deprecated: Use newTVarWithInvariantIO
newTMVarM :: MonadSTM m => a -> m ( StrictTMVar m a) Source #
Deprecated: Use newTVarIO
newEmptyTMVarM :: MonadSTM m => m ( StrictTMVar m a) Source #
Deprecated: Use newEmptyTMVarIO