Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Util.MonadSTM.NormalForm
Contents
Synopsis
- data StrictMVar m a = StrictMVar {}
- castStrictMVar ∷ (TMVar m ~ TMVar n, TVar m ~ TVar n) ⇒ StrictMVar m a → StrictMVar n a
- takeMVar ∷ MonadSTM m ⇒ StrictMVar m a → m a
- tryTakeMVar ∷ MonadSTM m ⇒ StrictMVar m a → m (Maybe a)
- putMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m ()
- tryPutMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m Bool
- readMVar ∷ MonadSTM m ⇒ StrictMVar m a → m a
- tryReadMVar ∷ MonadSTM m ⇒ StrictMVar m a → m (Maybe a)
- readMVarSTM ∷ MonadSTM m ⇒ StrictMVar m a → STM m a
- swapMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m a
- isEmptyMVar ∷ MonadSTM m ⇒ StrictMVar m a → m Bool
- updateMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → (a → (a, b)) → m b
- updateMVar_ ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → (a → a) → m ()
- modifyMVar ∷ (MonadSTM m, MonadCatch m, HasCallStack) ⇒ StrictMVar m a → (a → m (a, b)) → m b
- modifyMVar_ ∷ (MonadSTM m, MonadCatch m, HasCallStack) ⇒ StrictMVar m a → (a → m a) → m ()
- 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
- data StrictTVar (m ∷ Type → Type) a
- throwSTM ∷ ∀ (m ∷ Type → Type) e a. (MonadSTM m, MonadThrow (STM m), Exception e) ⇒ e → STM m a
- 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)
- class MonadSTM m ⇒ MonadLabelledSTM (m ∷ Type → Type)
- class MonadInspectSTM m ⇒ MonadTraceSTM (m ∷ Type → Type)
- data TraceValue where
- TraceValue ∷ ∀ tr. Typeable tr ⇒ {..} → TraceValue
- pattern TraceString ∷ String → TraceValue
- pattern DontTrace ∷ TraceValue
- pattern TraceDynamic ∷ () ⇒ Typeable tr ⇒ tr → TraceValue
- newtype WrappedSTM (t ∷ Trans) r (m ∷ Type → Type) a = WrappedSTM {
- runWrappedSTM ∷ STM m a
- castStrictTVar ∷ ∀ (m ∷ Type → Type) (n ∷ Type → Type) a. LazyTVar m ~ LazyTVar n ⇒ StrictTVar m a → StrictTVar n a
- checkInvariant ∷ HasCallStack ⇒ Maybe String → a → a
- fromLazyTVar ∷ ∀ (m ∷ Type → Type) a. LazyTVar m a → StrictTVar m a
- labelTVar ∷ ∀ (m ∷ Type → Type) a. MonadLabelledSTM m ⇒ StrictTVar m a → String → STM m ()
- labelTVarIO ∷ MonadLabelledSTM m ⇒ StrictTVar m a → String → m ()
- modifyTVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTVar m a → (a → a) → STM m ()
- newTVarM ∷ MonadSTM m ⇒ a → m (StrictTVar m a)
- newTVarWithInvariant ∷ ∀ (m ∷ Type → Type) a. (MonadSTM m, HasCallStack) ⇒ (a → Maybe String) → a → STM m (StrictTVar m a)
- newTVarWithInvariantM ∷ (MonadSTM m, HasCallStack) ⇒ (a → Maybe String) → a → m (StrictTVar m a)
- readTVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTVar m a → STM m a
- readTVarIO ∷ MonadSTM m ⇒ StrictTVar m a → m a
- stateTVar ∷ ∀ (m ∷ Type → Type) s a. MonadSTM m ⇒ StrictTVar m s → (s → (a, s)) → STM m a
- swapTVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTVar m a → a → STM m a
- toLazyTVar ∷ ∀ (m ∷ Type → Type) a. StrictTVar m a → LazyTVar m a
- traceTVar ∷ ∀ (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 ()
- updateTVar ∷ ∀ (m ∷ Type → Type) s a. MonadSTM m ⇒ StrictTVar m s → (s → (a, s)) → STM m a
- writeTVar ∷ ∀ (m ∷ Type → Type) a. (MonadSTM m, HasCallStack) ⇒ StrictTVar m a → a → STM m ()
- type LazyTVar (m ∷ Type → Type) = TVar m
- castStrictTMVar ∷ ∀ (m ∷ Type → Type) (n ∷ Type → Type) a. LazyTMVar m ~ LazyTMVar n ⇒ StrictTMVar m a → StrictTMVar n a
- fromLazyTMVar ∷ ∀ (m ∷ Type → Type) a. LazyTMVar m a → StrictTMVar m a
- isEmptyTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m Bool
- labelTMVar ∷ ∀ (m ∷ Type → Type) a. MonadLabelledSTM m ⇒ StrictTMVar m a → String → STM m ()
- labelTMVarIO ∷ MonadLabelledSTM m ⇒ StrictTMVar m a → String → m ()
- newEmptyTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ STM m (StrictTMVar m a)
- newEmptyTMVarIO ∷ MonadSTM m ⇒ m (StrictTMVar m a)
- newEmptyTMVarM ∷ MonadSTM m ⇒ m (StrictTMVar m a)
- newTMVarM ∷ MonadSTM m ⇒ a → m (StrictTMVar m a)
- putTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m ()
- readTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m a
- swapTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m a
- takeTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m a
- traceTMVar ∷ ∀ (m ∷ Type → Type) proxy a. 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 ()
- tryPutTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m Bool
- tryReadTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a)
- tryTakeTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a)
- type LazyTMVar (m ∷ Type → Type) = TMVar m
- data StrictTMVar (m ∷ Type → Type) a
- newEmptyMVar ∷ (MonadSTM m, NoThunks a) ⇒ a → m (StrictMVar m a)
- newMVar ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → m (StrictMVar m a)
- newTVar ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → STM m (StrictTVar m a)
- newTVarIO ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → m (StrictTVar m a)
- uncheckedNewEmptyMVar ∷ MonadSTM m ⇒ a → m (StrictMVar m a)
- uncheckedNewMVar ∷ MonadSTM m ⇒ a → m (StrictMVar m a)
- uncheckedNewTVarM ∷ MonadSTM m ⇒ a → m (StrictTVar m a)
Documentation
data StrictMVar m a Source #
Strict MVar (modelled using a lazy TMVar
under the hood)
The StrictMVar
API is slightly stronger than the usual MVar
one, as we
offer a primitive to read the value of the MVar even if it is empty (in which
case we will return the oldest known stale one). See readMVarSTM
.
There is a weaker invariant for a StrictMVar
than for a StrictTVar
:
although all functions that modify the StrictMVar
check the invariant, we
do not guarantee that the value inside the StrictMVar
always satisfies
the invariant. Instead, we do guarantee that if the StrictMVar
is updated
with a value that does not satisfy the invariant, an exception is thrown. The
reason for this weaker guarantee is that leaving an MVar
empty can lead to
very hard to debug "blocked indefinitely" problems.
This is also the reason we do not offer support for an invariant in
StrictTMVar
: if we throw an exception from an STM transaction, the STM
transaction is not executed, and so we would not even be able to provide the
weaker guarantee that we provide for StrictMVar
.
Constructors
StrictMVar | |
Fields
|
Instances
NoThunks a ⇒ NoThunks (StrictMVar IO a) Source # | |
Defined in Ouroboros.Consensus.Util.MonadSTM.StrictMVar Methods noThunks ∷ Context → StrictMVar IO a → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → StrictMVar IO a → IO (Maybe ThunkInfo) # showTypeOf ∷ Proxy (StrictMVar IO a) → String # |
castStrictMVar ∷ (TMVar m ~ TMVar n, TVar m ~ TVar n) ⇒ StrictMVar m a → StrictMVar n a Source #
takeMVar ∷ MonadSTM m ⇒ StrictMVar m a → m a Source #
tryTakeMVar ∷ MonadSTM m ⇒ StrictMVar m a → m (Maybe a) Source #
putMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m () Source #
tryPutMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m Bool Source #
readMVar ∷ MonadSTM m ⇒ StrictMVar m a → m a Source #
tryReadMVar ∷ MonadSTM m ⇒ StrictMVar m a → m (Maybe a) Source #
readMVarSTM ∷ MonadSTM m ⇒ StrictMVar m a → STM m a Source #
Read the possibly-stale value of the MVar
Will return the current value of the MVar
if it non-empty, or the last
known value otherwise.
swapMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → a → m a Source #
Swap value of a StrictMVar
NOTE: Since swapping the value can't leave the StrictMVar
empty, we
could check the invariant first and only then swap. We nonetheless swap
first and check the invariant after to keep the semantics the same with
putMVar
, otherwise it will be difficult to understand when a StrictMVar
is updated and when it is not.
isEmptyMVar ∷ MonadSTM m ⇒ StrictMVar m a → m Bool Source #
updateMVar ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → (a → (a, b)) → m b Source #
updateMVar_ ∷ (MonadSTM m, HasCallStack) ⇒ StrictMVar m a → (a → a) → m () Source #
modifyMVar ∷ (MonadSTM m, MonadCatch m, HasCallStack) ⇒ StrictMVar m a → (a → m (a, b)) → m b Source #
modifyMVar_ ∷ (MonadSTM m, MonadCatch m, HasCallStack) ⇒ StrictMVar m a → (a → m a) → m () Source #
type family STM (m ∷ Type → Type) = (stm ∷ Type → Type) | stm → m #
Instances
type STM IO | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (WithEarlyExit m) Source # | |
Defined in Ouroboros.Consensus.Util.EarlyExit | |
type STM (ExceptT e m) | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (ReaderT r m) | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (StateT s m) | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (WriterT w m) | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (ContT r m) | |
Defined in Control.Monad.Class.MonadSTM.Internal | |
type STM (RWST r w s m) | |
Defined in Control.Monad.Class.MonadSTM.Internal |
class (Monad m, Alternative (STM m), MonadPlus (STM m)) ⇒ MonadSTM (m ∷ Type → Type) where #
Minimal complete definition
atomically, newTVar, readTVar, writeTVar, retry, orElse
Instances
MonadSTM IO | |
Defined in Control.Monad.Class.MonadSTM.Internal Methods atomically ∷ HasCallStack ⇒ STM IO a → IO a # newTVar ∷ a → STM IO (TVar IO a) readTVar ∷ TVar IO a → STM IO a writeTVar ∷ TVar IO a → a → STM IO () orElse ∷ STM IO a → STM IO a → STM IO a # modifyTVar ∷ TVar IO a → (a → a) → STM IO () modifyTVar' ∷ TVar IO a → (a → a) → STM IO () stateTVar ∷ TVar IO s → (s → (a, s)) → STM IO a swapTVar ∷ TVar IO a → a → STM IO a newTMVar ∷ a → STM IO (TMVar IO a) newEmptyTMVar ∷ STM IO (TMVar IO a) takeTMVar ∷ TMVar IO a → STM IO a tryTakeTMVar ∷ TMVar IO a → STM IO (Maybe a) putTMVar ∷ TMVar IO a → a → STM IO () tryPutTMVar ∷ TMVar IO a → a → STM IO Bool readTMVar ∷ TMVar IO a → STM IO a tryReadTMVar ∷ TMVar IO a → STM IO (Maybe a) swapTMVar ∷ TMVar IO a → a → STM IO a isEmptyTMVar ∷ TMVar IO a → STM IO Bool newTQueue ∷ STM IO (TQueue IO a) readTQueue ∷ TQueue IO a → STM IO a tryReadTQueue ∷ TQueue IO a → STM IO (Maybe a) peekTQueue ∷ TQueue IO a → STM IO a tryPeekTQueue ∷ TQueue IO a → STM IO (Maybe a) flushTQueue ∷ TQueue IO a → STM IO [a] writeTQueue ∷ TQueue IO a → a → STM IO () isEmptyTQueue ∷ TQueue IO a → STM IO Bool unGetTQueue ∷ TQueue IO a → a → STM IO () newTBQueue ∷ Natural → STM IO (TBQueue IO a) readTBQueue ∷ TBQueue IO a → STM IO a tryReadTBQueue ∷ TBQueue IO a → STM IO (Maybe a) peekTBQueue ∷ TBQueue IO a → STM IO a tryPeekTBQueue ∷ TBQueue IO a → STM IO (Maybe a) flushTBQueue ∷ TBQueue IO a → STM IO [a] writeTBQueue ∷ TBQueue IO a → a → STM IO () lengthTBQueue ∷ TBQueue IO a → STM IO Natural isEmptyTBQueue ∷ TBQueue IO a → STM IO Bool isFullTBQueue ∷ TBQueue IO a → STM IO Bool unGetTBQueue ∷ TBQueue IO a → a → STM IO () newTSem ∷ Integer → STM IO (TSem IO) waitTSem ∷ TSem IO → STM IO () signalTSem ∷ TSem IO → STM IO () signalTSemN ∷ Natural → TSem IO → STM IO () newTChan ∷ STM IO (TChan IO a) newBroadcastTChan ∷ STM IO (TChan IO a) dupTChan ∷ TChan IO a → STM IO (TChan IO a) cloneTChan ∷ TChan IO a → STM IO (TChan IO a) readTChan ∷ TChan IO a → STM IO a tryReadTChan ∷ TChan IO a → STM IO (Maybe a) peekTChan ∷ TChan IO a → STM IO a tryPeekTChan ∷ TChan IO a → STM IO (Maybe a) writeTChan ∷ TChan IO a → a → STM IO () unGetTChan ∷ TChan IO a → a → STM IO () isEmptyTChan ∷ TChan IO a → STM IO Bool newTVarIO ∷ a → IO (TVar IO a) readTVarIO ∷ TVar IO a → IO a newTMVarIO ∷ a → IO (TMVar IO a) newEmptyTMVarIO ∷ IO (TMVar IO a) newTQueueIO ∷ IO (TQueue IO a) newTBQueueIO ∷ Natural → IO (TBQueue IO a) newTChanIO ∷ IO (TChan IO a) newBroadcastTChanIO ∷ IO (TChan IO a) | |
MonadSTM m ⇒ MonadSTM (WithEarlyExit m) Source # | |
Defined in Ouroboros.Consensus.Util.EarlyExit Associated Types type STM (WithEarlyExit m) = (stm ∷ Type → Type) # type TVar (WithEarlyExit m) ∷ Type → Type type TMVar (WithEarlyExit m) ∷ Type → Type type TQueue (WithEarlyExit m) ∷ Type → Type type TBQueue (WithEarlyExit m) ∷ Type → Type type TArray (WithEarlyExit m) ∷ Type → Type → Type type TSem (WithEarlyExit m) type TChan (WithEarlyExit m) ∷ Type → Type Methods atomically ∷ HasCallStack ⇒ STM (WithEarlyExit m) a → WithEarlyExit m a # newTVar ∷ a → STM (WithEarlyExit m) (TVar (WithEarlyExit m) a) readTVar ∷ TVar (WithEarlyExit m) a → STM (WithEarlyExit m) a writeTVar ∷ TVar (WithEarlyExit m) a → a → STM (WithEarlyExit m) () retry ∷ STM (WithEarlyExit m) a # orElse ∷ STM (WithEarlyExit m) a → STM (WithEarlyExit m) a → STM (WithEarlyExit m) a # modifyTVar ∷ TVar (WithEarlyExit m) a → (a → a) → STM (WithEarlyExit m) () modifyTVar' ∷ TVar (WithEarlyExit m) a → (a → a) → STM (WithEarlyExit m) () stateTVar ∷ TVar (WithEarlyExit m) s → (s → (a, s)) → STM (WithEarlyExit m) a swapTVar ∷ TVar (WithEarlyExit m) a → a → STM (WithEarlyExit m) a check ∷ Bool → STM (WithEarlyExit m) () # newTMVar ∷ a → STM (WithEarlyExit m) (TMVar (WithEarlyExit m) a) newEmptyTMVar ∷ STM (WithEarlyExit m) (TMVar (WithEarlyExit m) a) takeTMVar ∷ TMVar (WithEarlyExit m) a → STM (WithEarlyExit m) a tryTakeTMVar ∷ TMVar (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) putTMVar ∷ TMVar (WithEarlyExit m) a → a → STM (WithEarlyExit m) () tryPutTMVar ∷ TMVar (WithEarlyExit m) a → a → STM (WithEarlyExit m) Bool readTMVar ∷ TMVar (WithEarlyExit m) a → STM (WithEarlyExit m) a tryReadTMVar ∷ TMVar (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) swapTMVar ∷ TMVar (WithEarlyExit m) a → a → STM (WithEarlyExit m) a isEmptyTMVar ∷ TMVar (WithEarlyExit m) a → STM (WithEarlyExit m) Bool newTQueue ∷ STM (WithEarlyExit m) (TQueue (WithEarlyExit m) a) readTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a tryReadTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) peekTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a tryPeekTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) flushTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) [a] writeTQueue ∷ TQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () isEmptyTQueue ∷ TQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Bool unGetTQueue ∷ TQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () newTBQueue ∷ Natural → STM (WithEarlyExit m) (TBQueue (WithEarlyExit m) a) readTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a tryReadTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) peekTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a tryPeekTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) flushTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) [a] writeTBQueue ∷ TBQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () lengthTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Natural isEmptyTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Bool isFullTBQueue ∷ TBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Bool unGetTBQueue ∷ TBQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () newTSem ∷ Integer → STM (WithEarlyExit m) (TSem (WithEarlyExit m)) waitTSem ∷ TSem (WithEarlyExit m) → STM (WithEarlyExit m) () signalTSem ∷ TSem (WithEarlyExit m) → STM (WithEarlyExit m) () signalTSemN ∷ Natural → TSem (WithEarlyExit m) → STM (WithEarlyExit m) () newTChan ∷ STM (WithEarlyExit m) (TChan (WithEarlyExit m) a) newBroadcastTChan ∷ STM (WithEarlyExit m) (TChan (WithEarlyExit m) a) dupTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) (TChan (WithEarlyExit m) a) cloneTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) (TChan (WithEarlyExit m) a) readTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) a tryReadTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) peekTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) a tryPeekTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) writeTChan ∷ TChan (WithEarlyExit m) a → a → STM (WithEarlyExit m) () unGetTChan ∷ TChan (WithEarlyExit m) a → a → STM (WithEarlyExit m) () isEmptyTChan ∷ TChan (WithEarlyExit m) a → STM (WithEarlyExit m) Bool newTVarIO ∷ a → WithEarlyExit m (TVar (WithEarlyExit m) a) readTVarIO ∷ TVar (WithEarlyExit m) a → WithEarlyExit m a newTMVarIO ∷ a → WithEarlyExit m (TMVar (WithEarlyExit m) a) newEmptyTMVarIO ∷ WithEarlyExit m (TMVar (WithEarlyExit m) a) newTQueueIO ∷ WithEarlyExit m (TQueue (WithEarlyExit m) a) newTBQueueIO ∷ Natural → WithEarlyExit m (TBQueue (WithEarlyExit m) a) newTChanIO ∷ WithEarlyExit m (TChan (WithEarlyExit m) a) newBroadcastTChanIO ∷ WithEarlyExit m (TChan (WithEarlyExit m) a) | |
MonadSTM m ⇒ MonadSTM (ExceptT e m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (ExceptT e m) = (stm ∷ Type → Type) # type TVar (ExceptT e m) ∷ Type → Type type TMVar (ExceptT e m) ∷ Type → Type type TQueue (ExceptT e m) ∷ Type → Type type TBQueue (ExceptT e m) ∷ Type → Type type TArray (ExceptT e m) ∷ Type → Type → Type type TSem (ExceptT e m) Methods atomically ∷ HasCallStack ⇒ STM (ExceptT e m) a → ExceptT e m a # newTVar ∷ a → STM (ExceptT e m) (TVar (ExceptT e m) a) readTVar ∷ TVar (ExceptT e m) a → STM (ExceptT e m) a writeTVar ∷ TVar (ExceptT e m) a → a → STM (ExceptT e m) () orElse ∷ STM (ExceptT e m) a → STM (ExceptT e m) a → STM (ExceptT e m) a # modifyTVar ∷ TVar (ExceptT e m) a → (a → a) → STM (ExceptT e m) () modifyTVar' ∷ TVar (ExceptT e m) a → (a → a) → STM (ExceptT e m) () stateTVar ∷ TVar (ExceptT e m) s → (s → (a, s)) → STM (ExceptT e m) a swapTVar ∷ TVar (ExceptT e m) a → a → STM (ExceptT e m) a check ∷ Bool → STM (ExceptT e m) () # newTMVar ∷ a → STM (ExceptT e m) (TMVar (ExceptT e m) a) newEmptyTMVar ∷ STM (ExceptT e m) (TMVar (ExceptT e m) a) takeTMVar ∷ TMVar (ExceptT e m) a → STM (ExceptT e m) a tryTakeTMVar ∷ TMVar (ExceptT e m) a → STM (ExceptT e m) (Maybe a) putTMVar ∷ TMVar (ExceptT e m) a → a → STM (ExceptT e m) () tryPutTMVar ∷ TMVar (ExceptT e m) a → a → STM (ExceptT e m) Bool readTMVar ∷ TMVar (ExceptT e m) a → STM (ExceptT e m) a tryReadTMVar ∷ TMVar (ExceptT e m) a → STM (ExceptT e m) (Maybe a) swapTMVar ∷ TMVar (ExceptT e m) a → a → STM (ExceptT e m) a isEmptyTMVar ∷ TMVar (ExceptT e m) a → STM (ExceptT e m) Bool newTQueue ∷ STM (ExceptT e m) (TQueue (ExceptT e m) a) readTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) a tryReadTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) peekTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) a tryPeekTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) flushTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) [a] writeTQueue ∷ TQueue (ExceptT e m) a → a → STM (ExceptT e m) () isEmptyTQueue ∷ TQueue (ExceptT e m) a → STM (ExceptT e m) Bool unGetTQueue ∷ TQueue (ExceptT e m) a → a → STM (ExceptT e m) () newTBQueue ∷ Natural → STM (ExceptT e m) (TBQueue (ExceptT e m) a) readTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) a tryReadTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) peekTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) a tryPeekTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) flushTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) [a] writeTBQueue ∷ TBQueue (ExceptT e m) a → a → STM (ExceptT e m) () lengthTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) Natural isEmptyTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) Bool isFullTBQueue ∷ TBQueue (ExceptT e m) a → STM (ExceptT e m) Bool unGetTBQueue ∷ TBQueue (ExceptT e m) a → a → STM (ExceptT e m) () newTSem ∷ Integer → STM (ExceptT e m) (TSem (ExceptT e m)) waitTSem ∷ TSem (ExceptT e m) → STM (ExceptT e m) () signalTSem ∷ TSem (ExceptT e m) → STM (ExceptT e m) () signalTSemN ∷ Natural → TSem (ExceptT e m) → STM (ExceptT e m) () newTChan ∷ STM (ExceptT e m) (TChan (ExceptT e m) a) newBroadcastTChan ∷ STM (ExceptT e m) (TChan (ExceptT e m) a) dupTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) (TChan (ExceptT e m) a) cloneTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) (TChan (ExceptT e m) a) readTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) a tryReadTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) (Maybe a) peekTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) a tryPeekTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) (Maybe a) writeTChan ∷ TChan (ExceptT e m) a → a → STM (ExceptT e m) () unGetTChan ∷ TChan (ExceptT e m) a → a → STM (ExceptT e m) () isEmptyTChan ∷ TChan (ExceptT e m) a → STM (ExceptT e m) Bool newTVarIO ∷ a → ExceptT e m (TVar (ExceptT e m) a) readTVarIO ∷ TVar (ExceptT e m) a → ExceptT e m a newTMVarIO ∷ a → ExceptT e m (TMVar (ExceptT e m) a) newEmptyTMVarIO ∷ ExceptT e m (TMVar (ExceptT e m) a) newTQueueIO ∷ ExceptT e m (TQueue (ExceptT e m) a) newTBQueueIO ∷ Natural → ExceptT e m (TBQueue (ExceptT e m) a) newTChanIO ∷ ExceptT e m (TChan (ExceptT e m) a) newBroadcastTChanIO ∷ ExceptT e m (TChan (ExceptT e m) a) | |
MonadSTM m ⇒ MonadSTM (ReaderT r m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (ReaderT r m) = (stm ∷ Type → Type) # type TVar (ReaderT r m) ∷ Type → Type type TMVar (ReaderT r m) ∷ Type → Type type TQueue (ReaderT r m) ∷ Type → Type type TBQueue (ReaderT r m) ∷ Type → Type type TArray (ReaderT r m) ∷ Type → Type → Type type TSem (ReaderT r m) Methods atomically ∷ HasCallStack ⇒ STM (ReaderT r m) a → ReaderT r m a # newTVar ∷ a → STM (ReaderT r m) (TVar (ReaderT r m) a) readTVar ∷ TVar (ReaderT r m) a → STM (ReaderT r m) a writeTVar ∷ TVar (ReaderT r m) a → a → STM (ReaderT r m) () orElse ∷ STM (ReaderT r m) a → STM (ReaderT r m) a → STM (ReaderT r m) a # modifyTVar ∷ TVar (ReaderT r m) a → (a → a) → STM (ReaderT r m) () modifyTVar' ∷ TVar (ReaderT r m) a → (a → a) → STM (ReaderT r m) () stateTVar ∷ TVar (ReaderT r m) s → (s → (a, s)) → STM (ReaderT r m) a swapTVar ∷ TVar (ReaderT r m) a → a → STM (ReaderT r m) a check ∷ Bool → STM (ReaderT r m) () # newTMVar ∷ a → STM (ReaderT r m) (TMVar (ReaderT r m) a) newEmptyTMVar ∷ STM (ReaderT r m) (TMVar (ReaderT r m) a) takeTMVar ∷ TMVar (ReaderT r m) a → STM (ReaderT r m) a tryTakeTMVar ∷ TMVar (ReaderT r m) a → STM (ReaderT r m) (Maybe a) putTMVar ∷ TMVar (ReaderT r m) a → a → STM (ReaderT r m) () tryPutTMVar ∷ TMVar (ReaderT r m) a → a → STM (ReaderT r m) Bool readTMVar ∷ TMVar (ReaderT r m) a → STM (ReaderT r m) a tryReadTMVar ∷ TMVar (ReaderT r m) a → STM (ReaderT r m) (Maybe a) swapTMVar ∷ TMVar (ReaderT r m) a → a → STM (ReaderT r m) a isEmptyTMVar ∷ TMVar (ReaderT r m) a → STM (ReaderT r m) Bool newTQueue ∷ STM (ReaderT r m) (TQueue (ReaderT r m) a) readTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) a tryReadTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) peekTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) a tryPeekTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) flushTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) [a] writeTQueue ∷ TQueue (ReaderT r m) a → a → STM (ReaderT r m) () isEmptyTQueue ∷ TQueue (ReaderT r m) a → STM (ReaderT r m) Bool unGetTQueue ∷ TQueue (ReaderT r m) a → a → STM (ReaderT r m) () newTBQueue ∷ Natural → STM (ReaderT r m) (TBQueue (ReaderT r m) a) readTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) a tryReadTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) peekTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) a tryPeekTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) flushTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) [a] writeTBQueue ∷ TBQueue (ReaderT r m) a → a → STM (ReaderT r m) () lengthTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) Natural isEmptyTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) Bool isFullTBQueue ∷ TBQueue (ReaderT r m) a → STM (ReaderT r m) Bool unGetTBQueue ∷ TBQueue (ReaderT r m) a → a → STM (ReaderT r m) () newTSem ∷ Integer → STM (ReaderT r m) (TSem (ReaderT r m)) waitTSem ∷ TSem (ReaderT r m) → STM (ReaderT r m) () signalTSem ∷ TSem (ReaderT r m) → STM (ReaderT r m) () signalTSemN ∷ Natural → TSem (ReaderT r m) → STM (ReaderT r m) () newTChan ∷ STM (ReaderT r m) (TChan (ReaderT r m) a) newBroadcastTChan ∷ STM (ReaderT r m) (TChan (ReaderT r m) a) dupTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) (TChan (ReaderT r m) a) cloneTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) (TChan (ReaderT r m) a) readTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) a tryReadTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) (Maybe a) peekTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) a tryPeekTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) (Maybe a) writeTChan ∷ TChan (ReaderT r m) a → a → STM (ReaderT r m) () unGetTChan ∷ TChan (ReaderT r m) a → a → STM (ReaderT r m) () isEmptyTChan ∷ TChan (ReaderT r m) a → STM (ReaderT r m) Bool newTVarIO ∷ a → ReaderT r m (TVar (ReaderT r m) a) readTVarIO ∷ TVar (ReaderT r m) a → ReaderT r m a newTMVarIO ∷ a → ReaderT r m (TMVar (ReaderT r m) a) newEmptyTMVarIO ∷ ReaderT r m (TMVar (ReaderT r m) a) newTQueueIO ∷ ReaderT r m (TQueue (ReaderT r m) a) newTBQueueIO ∷ Natural → ReaderT r m (TBQueue (ReaderT r m) a) newTChanIO ∷ ReaderT r m (TChan (ReaderT r m) a) newBroadcastTChanIO ∷ ReaderT r m (TChan (ReaderT r m) a) | |
MonadSTM m ⇒ MonadSTM (StateT s m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (StateT s m) = (stm ∷ Type → Type) # type TVar (StateT s m) ∷ Type → Type type TMVar (StateT s m) ∷ Type → Type type TQueue (StateT s m) ∷ Type → Type type TBQueue (StateT s m) ∷ Type → Type type TArray (StateT s m) ∷ Type → Type → Type type TSem (StateT s m) Methods atomically ∷ HasCallStack ⇒ STM (StateT s m) a → StateT s m a # newTVar ∷ a → STM (StateT s m) (TVar (StateT s m) a) readTVar ∷ TVar (StateT s m) a → STM (StateT s m) a writeTVar ∷ TVar (StateT s m) a → a → STM (StateT s m) () orElse ∷ STM (StateT s m) a → STM (StateT s m) a → STM (StateT s m) a # modifyTVar ∷ TVar (StateT s m) a → (a → a) → STM (StateT s m) () modifyTVar' ∷ TVar (StateT s m) a → (a → a) → STM (StateT s m) () stateTVar ∷ TVar (StateT s m) s0 → (s0 → (a, s0)) → STM (StateT s m) a swapTVar ∷ TVar (StateT s m) a → a → STM (StateT s m) a check ∷ Bool → STM (StateT s m) () # newTMVar ∷ a → STM (StateT s m) (TMVar (StateT s m) a) newEmptyTMVar ∷ STM (StateT s m) (TMVar (StateT s m) a) takeTMVar ∷ TMVar (StateT s m) a → STM (StateT s m) a tryTakeTMVar ∷ TMVar (StateT s m) a → STM (StateT s m) (Maybe a) putTMVar ∷ TMVar (StateT s m) a → a → STM (StateT s m) () tryPutTMVar ∷ TMVar (StateT s m) a → a → STM (StateT s m) Bool readTMVar ∷ TMVar (StateT s m) a → STM (StateT s m) a tryReadTMVar ∷ TMVar (StateT s m) a → STM (StateT s m) (Maybe a) swapTMVar ∷ TMVar (StateT s m) a → a → STM (StateT s m) a isEmptyTMVar ∷ TMVar (StateT s m) a → STM (StateT s m) Bool newTQueue ∷ STM (StateT s m) (TQueue (StateT s m) a) readTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) a tryReadTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) (Maybe a) peekTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) a tryPeekTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) (Maybe a) flushTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) [a] writeTQueue ∷ TQueue (StateT s m) a → a → STM (StateT s m) () isEmptyTQueue ∷ TQueue (StateT s m) a → STM (StateT s m) Bool unGetTQueue ∷ TQueue (StateT s m) a → a → STM (StateT s m) () newTBQueue ∷ Natural → STM (StateT s m) (TBQueue (StateT s m) a) readTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) a tryReadTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) (Maybe a) peekTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) a tryPeekTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) (Maybe a) flushTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) [a] writeTBQueue ∷ TBQueue (StateT s m) a → a → STM (StateT s m) () lengthTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) Natural isEmptyTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) Bool isFullTBQueue ∷ TBQueue (StateT s m) a → STM (StateT s m) Bool unGetTBQueue ∷ TBQueue (StateT s m) a → a → STM (StateT s m) () newTSem ∷ Integer → STM (StateT s m) (TSem (StateT s m)) waitTSem ∷ TSem (StateT s m) → STM (StateT s m) () signalTSem ∷ TSem (StateT s m) → STM (StateT s m) () signalTSemN ∷ Natural → TSem (StateT s m) → STM (StateT s m) () newTChan ∷ STM (StateT s m) (TChan (StateT s m) a) newBroadcastTChan ∷ STM (StateT s m) (TChan (StateT s m) a) dupTChan ∷ TChan (StateT s m) a → STM (StateT s m) (TChan (StateT s m) a) cloneTChan ∷ TChan (StateT s m) a → STM (StateT s m) (TChan (StateT s m) a) readTChan ∷ TChan (StateT s m) a → STM (StateT s m) a tryReadTChan ∷ TChan (StateT s m) a → STM (StateT s m) (Maybe a) peekTChan ∷ TChan (StateT s m) a → STM (StateT s m) a tryPeekTChan ∷ TChan (StateT s m) a → STM (StateT s m) (Maybe a) writeTChan ∷ TChan (StateT s m) a → a → STM (StateT s m) () unGetTChan ∷ TChan (StateT s m) a → a → STM (StateT s m) () isEmptyTChan ∷ TChan (StateT s m) a → STM (StateT s m) Bool newTVarIO ∷ a → StateT s m (TVar (StateT s m) a) readTVarIO ∷ TVar (StateT s m) a → StateT s m a newTMVarIO ∷ a → StateT s m (TMVar (StateT s m) a) newEmptyTMVarIO ∷ StateT s m (TMVar (StateT s m) a) newTQueueIO ∷ StateT s m (TQueue (StateT s m) a) newTBQueueIO ∷ Natural → StateT s m (TBQueue (StateT s m) a) newTChanIO ∷ StateT s m (TChan (StateT s m) a) newBroadcastTChanIO ∷ StateT s m (TChan (StateT s m) a) | |
(Monoid w, MonadSTM m) ⇒ MonadSTM (WriterT w m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (WriterT w m) = (stm ∷ Type → Type) # type TVar (WriterT w m) ∷ Type → Type type TMVar (WriterT w m) ∷ Type → Type type TQueue (WriterT w m) ∷ Type → Type type TBQueue (WriterT w m) ∷ Type → Type type TArray (WriterT w m) ∷ Type → Type → Type type TSem (WriterT w m) Methods atomically ∷ HasCallStack ⇒ STM (WriterT w m) a → WriterT w m a # newTVar ∷ a → STM (WriterT w m) (TVar (WriterT w m) a) readTVar ∷ TVar (WriterT w m) a → STM (WriterT w m) a writeTVar ∷ TVar (WriterT w m) a → a → STM (WriterT w m) () orElse ∷ STM (WriterT w m) a → STM (WriterT w m) a → STM (WriterT w m) a # modifyTVar ∷ TVar (WriterT w m) a → (a → a) → STM (WriterT w m) () modifyTVar' ∷ TVar (WriterT w m) a → (a → a) → STM (WriterT w m) () stateTVar ∷ TVar (WriterT w m) s → (s → (a, s)) → STM (WriterT w m) a swapTVar ∷ TVar (WriterT w m) a → a → STM (WriterT w m) a check ∷ Bool → STM (WriterT w m) () # newTMVar ∷ a → STM (WriterT w m) (TMVar (WriterT w m) a) newEmptyTMVar ∷ STM (WriterT w m) (TMVar (WriterT w m) a) takeTMVar ∷ TMVar (WriterT w m) a → STM (WriterT w m) a tryTakeTMVar ∷ TMVar (WriterT w m) a → STM (WriterT w m) (Maybe a) putTMVar ∷ TMVar (WriterT w m) a → a → STM (WriterT w m) () tryPutTMVar ∷ TMVar (WriterT w m) a → a → STM (WriterT w m) Bool readTMVar ∷ TMVar (WriterT w m) a → STM (WriterT w m) a tryReadTMVar ∷ TMVar (WriterT w m) a → STM (WriterT w m) (Maybe a) swapTMVar ∷ TMVar (WriterT w m) a → a → STM (WriterT w m) a isEmptyTMVar ∷ TMVar (WriterT w m) a → STM (WriterT w m) Bool newTQueue ∷ STM (WriterT w m) (TQueue (WriterT w m) a) readTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) a tryReadTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) peekTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) a tryPeekTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) flushTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) [a] writeTQueue ∷ TQueue (WriterT w m) a → a → STM (WriterT w m) () isEmptyTQueue ∷ TQueue (WriterT w m) a → STM (WriterT w m) Bool unGetTQueue ∷ TQueue (WriterT w m) a → a → STM (WriterT w m) () newTBQueue ∷ Natural → STM (WriterT w m) (TBQueue (WriterT w m) a) readTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) a tryReadTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) peekTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) a tryPeekTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) flushTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) [a] writeTBQueue ∷ TBQueue (WriterT w m) a → a → STM (WriterT w m) () lengthTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) Natural isEmptyTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) Bool isFullTBQueue ∷ TBQueue (WriterT w m) a → STM (WriterT w m) Bool unGetTBQueue ∷ TBQueue (WriterT w m) a → a → STM (WriterT w m) () newTSem ∷ Integer → STM (WriterT w m) (TSem (WriterT w m)) waitTSem ∷ TSem (WriterT w m) → STM (WriterT w m) () signalTSem ∷ TSem (WriterT w m) → STM (WriterT w m) () signalTSemN ∷ Natural → TSem (WriterT w m) → STM (WriterT w m) () newTChan ∷ STM (WriterT w m) (TChan (WriterT w m) a) newBroadcastTChan ∷ STM (WriterT w m) (TChan (WriterT w m) a) dupTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) (TChan (WriterT w m) a) cloneTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) (TChan (WriterT w m) a) readTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) a tryReadTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) (Maybe a) peekTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) a tryPeekTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) (Maybe a) writeTChan ∷ TChan (WriterT w m) a → a → STM (WriterT w m) () unGetTChan ∷ TChan (WriterT w m) a → a → STM (WriterT w m) () isEmptyTChan ∷ TChan (WriterT w m) a → STM (WriterT w m) Bool newTVarIO ∷ a → WriterT w m (TVar (WriterT w m) a) readTVarIO ∷ TVar (WriterT w m) a → WriterT w m a newTMVarIO ∷ a → WriterT w m (TMVar (WriterT w m) a) newEmptyTMVarIO ∷ WriterT w m (TMVar (WriterT w m) a) newTQueueIO ∷ WriterT w m (TQueue (WriterT w m) a) newTBQueueIO ∷ Natural → WriterT w m (TBQueue (WriterT w m) a) newTChanIO ∷ WriterT w m (TChan (WriterT w m) a) newBroadcastTChanIO ∷ WriterT w m (TChan (WriterT w m) a) | |
MonadSTM m ⇒ MonadSTM (ContT r m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (ContT r m) = (stm ∷ Type → Type) # type TVar (ContT r m) ∷ Type → Type type TMVar (ContT r m) ∷ Type → Type type TQueue (ContT r m) ∷ Type → Type type TBQueue (ContT r m) ∷ Type → Type type TArray (ContT r m) ∷ Type → Type → Type type TSem (ContT r m) Methods atomically ∷ HasCallStack ⇒ STM (ContT r m) a → ContT r m a # newTVar ∷ a → STM (ContT r m) (TVar (ContT r m) a) readTVar ∷ TVar (ContT r m) a → STM (ContT r m) a writeTVar ∷ TVar (ContT r m) a → a → STM (ContT r m) () orElse ∷ STM (ContT r m) a → STM (ContT r m) a → STM (ContT r m) a # modifyTVar ∷ TVar (ContT r m) a → (a → a) → STM (ContT r m) () modifyTVar' ∷ TVar (ContT r m) a → (a → a) → STM (ContT r m) () stateTVar ∷ TVar (ContT r m) s → (s → (a, s)) → STM (ContT r m) a swapTVar ∷ TVar (ContT r m) a → a → STM (ContT r m) a check ∷ Bool → STM (ContT r m) () # newTMVar ∷ a → STM (ContT r m) (TMVar (ContT r m) a) newEmptyTMVar ∷ STM (ContT r m) (TMVar (ContT r m) a) takeTMVar ∷ TMVar (ContT r m) a → STM (ContT r m) a tryTakeTMVar ∷ TMVar (ContT r m) a → STM (ContT r m) (Maybe a) putTMVar ∷ TMVar (ContT r m) a → a → STM (ContT r m) () tryPutTMVar ∷ TMVar (ContT r m) a → a → STM (ContT r m) Bool readTMVar ∷ TMVar (ContT r m) a → STM (ContT r m) a tryReadTMVar ∷ TMVar (ContT r m) a → STM (ContT r m) (Maybe a) swapTMVar ∷ TMVar (ContT r m) a → a → STM (ContT r m) a isEmptyTMVar ∷ TMVar (ContT r m) a → STM (ContT r m) Bool newTQueue ∷ STM (ContT r m) (TQueue (ContT r m) a) readTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) a tryReadTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) (Maybe a) peekTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) a tryPeekTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) (Maybe a) flushTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) [a] writeTQueue ∷ TQueue (ContT r m) a → a → STM (ContT r m) () isEmptyTQueue ∷ TQueue (ContT r m) a → STM (ContT r m) Bool unGetTQueue ∷ TQueue (ContT r m) a → a → STM (ContT r m) () newTBQueue ∷ Natural → STM (ContT r m) (TBQueue (ContT r m) a) readTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) a tryReadTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) (Maybe a) peekTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) a tryPeekTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) (Maybe a) flushTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) [a] writeTBQueue ∷ TBQueue (ContT r m) a → a → STM (ContT r m) () lengthTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) Natural isEmptyTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) Bool isFullTBQueue ∷ TBQueue (ContT r m) a → STM (ContT r m) Bool unGetTBQueue ∷ TBQueue (ContT r m) a → a → STM (ContT r m) () newTSem ∷ Integer → STM (ContT r m) (TSem (ContT r m)) waitTSem ∷ TSem (ContT r m) → STM (ContT r m) () signalTSem ∷ TSem (ContT r m) → STM (ContT r m) () signalTSemN ∷ Natural → TSem (ContT r m) → STM (ContT r m) () newTChan ∷ STM (ContT r m) (TChan (ContT r m) a) newBroadcastTChan ∷ STM (ContT r m) (TChan (ContT r m) a) dupTChan ∷ TChan (ContT r m) a → STM (ContT r m) (TChan (ContT r m) a) cloneTChan ∷ TChan (ContT r m) a → STM (ContT r m) (TChan (ContT r m) a) readTChan ∷ TChan (ContT r m) a → STM (ContT r m) a tryReadTChan ∷ TChan (ContT r m) a → STM (ContT r m) (Maybe a) peekTChan ∷ TChan (ContT r m) a → STM (ContT r m) a tryPeekTChan ∷ TChan (ContT r m) a → STM (ContT r m) (Maybe a) writeTChan ∷ TChan (ContT r m) a → a → STM (ContT r m) () unGetTChan ∷ TChan (ContT r m) a → a → STM (ContT r m) () isEmptyTChan ∷ TChan (ContT r m) a → STM (ContT r m) Bool newTVarIO ∷ a → ContT r m (TVar (ContT r m) a) readTVarIO ∷ TVar (ContT r m) a → ContT r m a newTMVarIO ∷ a → ContT r m (TMVar (ContT r m) a) newEmptyTMVarIO ∷ ContT r m (TMVar (ContT r m) a) newTQueueIO ∷ ContT r m (TQueue (ContT r m) a) newTBQueueIO ∷ Natural → ContT r m (TBQueue (ContT r m) a) newTChanIO ∷ ContT r m (TChan (ContT r m) a) newBroadcastTChanIO ∷ ContT r m (TChan (ContT r m) a) | |
(Monoid w, MonadSTM m) ⇒ MonadSTM (RWST r w s m) | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type STM (RWST r w s m) = (stm ∷ Type → Type) # type TVar (RWST r w s m) ∷ Type → Type type TMVar (RWST r w s m) ∷ Type → Type type TQueue (RWST r w s m) ∷ Type → Type type TBQueue (RWST r w s m) ∷ Type → Type type TArray (RWST r w s m) ∷ Type → Type → Type type TSem (RWST r w s m) Methods atomically ∷ HasCallStack ⇒ STM (RWST r w s m) a → RWST r w s m a # newTVar ∷ a → STM (RWST r w s m) (TVar (RWST r w s m) a) readTVar ∷ TVar (RWST r w s m) a → STM (RWST r w s m) a writeTVar ∷ TVar (RWST r w s m) a → a → STM (RWST r w s m) () retry ∷ STM (RWST r w s m) a # orElse ∷ STM (RWST r w s m) a → STM (RWST r w s m) a → STM (RWST r w s m) a # modifyTVar ∷ TVar (RWST r w s m) a → (a → a) → STM (RWST r w s m) () modifyTVar' ∷ TVar (RWST r w s m) a → (a → a) → STM (RWST r w s m) () stateTVar ∷ TVar (RWST r w s m) s0 → (s0 → (a, s0)) → STM (RWST r w s m) a swapTVar ∷ TVar (RWST r w s m) a → a → STM (RWST r w s m) a check ∷ Bool → STM (RWST r w s m) () # newTMVar ∷ a → STM (RWST r w s m) (TMVar (RWST r w s m) a) newEmptyTMVar ∷ STM (RWST r w s m) (TMVar (RWST r w s m) a) takeTMVar ∷ TMVar (RWST r w s m) a → STM (RWST r w s m) a tryTakeTMVar ∷ TMVar (RWST r w s m) a → STM (RWST r w s m) (Maybe a) putTMVar ∷ TMVar (RWST r w s m) a → a → STM (RWST r w s m) () tryPutTMVar ∷ TMVar (RWST r w s m) a → a → STM (RWST r w s m) Bool readTMVar ∷ TMVar (RWST r w s m) a → STM (RWST r w s m) a tryReadTMVar ∷ TMVar (RWST r w s m) a → STM (RWST r w s m) (Maybe a) swapTMVar ∷ TMVar (RWST r w s m) a → a → STM (RWST r w s m) a isEmptyTMVar ∷ TMVar (RWST r w s m) a → STM (RWST r w s m) Bool newTQueue ∷ STM (RWST r w s m) (TQueue (RWST r w s m) a) readTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) a tryReadTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) peekTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) a tryPeekTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) flushTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) [a] writeTQueue ∷ TQueue (RWST r w s m) a → a → STM (RWST r w s m) () isEmptyTQueue ∷ TQueue (RWST r w s m) a → STM (RWST r w s m) Bool unGetTQueue ∷ TQueue (RWST r w s m) a → a → STM (RWST r w s m) () newTBQueue ∷ Natural → STM (RWST r w s m) (TBQueue (RWST r w s m) a) readTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) a tryReadTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) peekTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) a tryPeekTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) flushTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) [a] writeTBQueue ∷ TBQueue (RWST r w s m) a → a → STM (RWST r w s m) () lengthTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) Natural isEmptyTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) Bool isFullTBQueue ∷ TBQueue (RWST r w s m) a → STM (RWST r w s m) Bool unGetTBQueue ∷ TBQueue (RWST r w s m) a → a → STM (RWST r w s m) () newTSem ∷ Integer → STM (RWST r w s m) (TSem (RWST r w s m)) waitTSem ∷ TSem (RWST r w s m) → STM (RWST r w s m) () signalTSem ∷ TSem (RWST r w s m) → STM (RWST r w s m) () signalTSemN ∷ Natural → TSem (RWST r w s m) → STM (RWST r w s m) () newTChan ∷ STM (RWST r w s m) (TChan (RWST r w s m) a) newBroadcastTChan ∷ STM (RWST r w s m) (TChan (RWST r w s m) a) dupTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) (TChan (RWST r w s m) a) cloneTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) (TChan (RWST r w s m) a) readTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) a tryReadTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) (Maybe a) peekTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) a tryPeekTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) (Maybe a) writeTChan ∷ TChan (RWST r w s m) a → a → STM (RWST r w s m) () unGetTChan ∷ TChan (RWST r w s m) a → a → STM (RWST r w s m) () isEmptyTChan ∷ TChan (RWST r w s m) a → STM (RWST r w s m) Bool newTVarIO ∷ a → RWST r w s m (TVar (RWST r w s m) a) readTVarIO ∷ TVar (RWST r w s m) a → RWST r w s m a newTMVarIO ∷ a → RWST r w s m (TMVar (RWST r w s m) a) newEmptyTMVarIO ∷ RWST r w s m (TMVar (RWST r w s m) a) newTQueueIO ∷ RWST r w s m (TQueue (RWST r w s m) a) newTBQueueIO ∷ Natural → RWST r w s m (TBQueue (RWST r w s m) a) newTChanIO ∷ RWST r w s m (TChan (RWST r w s m) a) newBroadcastTChanIO ∷ RWST r w s m (TChan (RWST r w s m) a) |
data StrictTVar (m ∷ Type → Type) a #
Instances
NoThunks a ⇒ NoThunks (StrictTVar IO a) Source # | |
Defined in Ouroboros.Consensus.Util.Orphans Methods noThunks ∷ Context → StrictTVar IO a → IO (Maybe ThunkInfo) # wNoThunks ∷ Context → StrictTVar IO a → IO (Maybe ThunkInfo) # showTypeOf ∷ Proxy (StrictTVar IO a) → String # |
type family InspectMonad (m ∷ Type → Type) ∷ Type → Type #
Instances
type InspectMonad IO | |
Defined in Control.Monad.Class.MonadSTM.Internal |
class (MonadSTM m, Monad (InspectMonad m)) ⇒ MonadInspectSTM (m ∷ Type → Type) where #
Methods
inspectTVar ∷ proxy m → TVar m a → InspectMonad m a #
inspectTMVar ∷ proxy m → TMVar m a → InspectMonad m (Maybe a) #
Instances
MonadInspectSTM IO | |
Defined in Control.Monad.Class.MonadSTM.Internal Associated Types type InspectMonad IO ∷ Type → Type # Methods inspectTVar ∷ proxy IO → TVar IO a → InspectMonad IO a # inspectTMVar ∷ proxy IO → TMVar IO a → InspectMonad IO (Maybe a) # |
class MonadSTM m ⇒ MonadLabelledSTM (m ∷ Type → Type) #
Minimal complete definition
labelTVar
Instances
MonadLabelledSTM IO | |
Defined in Control.Monad.Class.MonadSTM.Internal Methods labelTVar ∷ TVar IO a → String → STM IO () labelTMVar ∷ TMVar IO a → String → STM IO () labelTQueue ∷ TQueue IO a → String → STM IO () labelTBQueue ∷ TBQueue IO a → String → STM IO () labelTArray ∷ (Ix i, Show i) ⇒ TArray IO i e → String → STM IO () labelTSem ∷ TSem IO → String → STM IO () labelTChan ∷ TChan IO a → String → STM IO () labelTVarIO ∷ TVar IO a → String → IO () labelTMVarIO ∷ TMVar IO a → String → IO () labelTQueueIO ∷ TQueue IO a → String → IO () labelTBQueueIO ∷ TBQueue IO a → String → IO () labelTArrayIO ∷ (Ix i, Show i) ⇒ TArray IO i e → String → IO () labelTSemIO ∷ TSem IO → String → IO () labelTChanIO ∷ TChan IO a → String → IO () |
class MonadInspectSTM m ⇒ MonadTraceSTM (m ∷ Type → Type) #
Minimal complete definition
traceTVar, traceTQueue, traceTBQueue
Instances
MonadTraceSTM IO | |
Defined in Control.Monad.Class.MonadSTM.Internal Methods traceTVar ∷ proxy IO → TVar IO a → (Maybe a → a → InspectMonad IO TraceValue) → STM IO () traceTMVar ∷ proxy IO → TMVar IO a → (Maybe (Maybe a) → Maybe a → InspectMonad IO TraceValue) → STM IO () traceTQueue ∷ proxy IO → TQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → STM IO () traceTBQueue ∷ proxy IO → TBQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → STM IO () traceTSem ∷ proxy IO → TSem IO → (Maybe Integer → Integer → InspectMonad IO TraceValue) → STM IO () traceTVarIO ∷ TVar IO a → (Maybe a → a → InspectMonad IO TraceValue) → IO () traceTMVarIO ∷ TMVar IO a → (Maybe (Maybe a) → Maybe a → InspectMonad IO TraceValue) → IO () traceTQueueIO ∷ TQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → IO () traceTBQueueIO ∷ TBQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → IO () traceTSemIO ∷ TSem IO → (Maybe Integer → Integer → InspectMonad IO TraceValue) → IO () |
data TraceValue where #
Constructors
TraceValue | |
Fields
|
Bundled Patterns
pattern TraceString ∷ String → TraceValue | |
pattern DontTrace ∷ TraceValue | |
pattern TraceDynamic ∷ () ⇒ Typeable tr ⇒ tr → TraceValue |
newtype WrappedSTM (t ∷ Trans) r (m ∷ Type → Type) a #
Constructors
WrappedSTM | |
Fields
|
Instances
castStrictTVar ∷ ∀ (m ∷ Type → Type) (n ∷ Type → Type) a. LazyTVar m ~ LazyTVar n ⇒ StrictTVar m a → StrictTVar n a #
checkInvariant ∷ HasCallStack ⇒ Maybe String → a → a #
fromLazyTVar ∷ ∀ (m ∷ Type → Type) a. LazyTVar m a → StrictTVar m a #
labelTVar ∷ ∀ (m ∷ Type → Type) a. MonadLabelledSTM m ⇒ StrictTVar m a → String → STM m () #
labelTVarIO ∷ MonadLabelledSTM m ⇒ StrictTVar m a → String → m () #
modifyTVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTVar m a → (a → a) → STM m () #
newTVarM ∷ MonadSTM m ⇒ a → m (StrictTVar m a) #
newTVarWithInvariant ∷ ∀ (m ∷ Type → Type) a. (MonadSTM m, HasCallStack) ⇒ (a → Maybe String) → a → STM m (StrictTVar m a) #
newTVarWithInvariantM ∷ (MonadSTM m, HasCallStack) ⇒ (a → Maybe String) → a → m (StrictTVar m a) #
readTVarIO ∷ MonadSTM m ⇒ StrictTVar m a → m a #
toLazyTVar ∷ ∀ (m ∷ Type → Type) a. StrictTVar m a → LazyTVar m a #
traceTVar ∷ ∀ (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 () #
updateTVar ∷ ∀ (m ∷ Type → Type) s a. MonadSTM m ⇒ StrictTVar m s → (s → (a, s)) → STM m a #
writeTVar ∷ ∀ (m ∷ Type → Type) a. (MonadSTM m, HasCallStack) ⇒ StrictTVar m a → a → STM m () #
castStrictTMVar ∷ ∀ (m ∷ Type → Type) (n ∷ Type → Type) a. LazyTMVar m ~ LazyTMVar n ⇒ StrictTMVar m a → StrictTMVar n a #
fromLazyTMVar ∷ ∀ (m ∷ Type → Type) a. LazyTMVar m a → StrictTMVar m a #
isEmptyTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m Bool #
labelTMVar ∷ ∀ (m ∷ Type → Type) a. MonadLabelledSTM m ⇒ StrictTMVar m a → String → STM m () #
labelTMVarIO ∷ MonadLabelledSTM m ⇒ StrictTMVar m a → String → m () #
newEmptyTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ STM m (StrictTMVar m a) #
newEmptyTMVarIO ∷ MonadSTM m ⇒ m (StrictTMVar m a) #
newEmptyTMVarM ∷ MonadSTM m ⇒ m (StrictTMVar m a) #
newTMVarM ∷ MonadSTM m ⇒ a → m (StrictTMVar m a) #
traceTMVar ∷ ∀ (m ∷ Type → Type) proxy a. 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 () #
tryPutTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m Bool #
tryReadTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a) #
tryTakeTMVar ∷ ∀ (m ∷ Type → Type) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a) #
data StrictTMVar (m ∷ Type → Type) a #
newEmptyMVar ∷ (MonadSTM m, NoThunks a) ⇒ a → m (StrictMVar m a) Source #
newMVar ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → m (StrictMVar m a) Source #
newTVar ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → STM m (StrictTVar m a) Source #
newTVarIO ∷ (MonadSTM m, HasCallStack, NoThunks a) ⇒ a → m (StrictTVar m a) Source #
Temporary
uncheckedNewEmptyMVar ∷ MonadSTM m ⇒ a → m (StrictMVar m a) Source #
uncheckedNewMVar ∷ MonadSTM m ⇒ a → m (StrictMVar m a) Source #
uncheckedNewTVarM ∷ MonadSTM m ⇒ a → m (StrictTVar m a) Source #