ouroboros-consensus-0.1.0.2: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Util.MonadSTM.NormalForm

Contents

Synopsis

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

  • invariant ∷ !(a → Maybe String)

    Invariant checked whenever updating the StrictMVar.

  • tmvar ∷ !(TMVar m a)

    The main TMVar supporting this StrictMVar

  • tvar ∷ !(TVar m a)

    TVar for supporting readMVarSTM

    This TVar is always kept up to date with the TMVar, but holds on the old value of the TMVar when it is empty. This is very useful to support single writer/many reader scenarios.

    NOTE: We should always update the tmvar before the tvar so that if the update to the tmvar fails, the 'tvar is left unchanged.

Instances

Instances details
NoThunks a ⇒ NoThunks (StrictMVar IO a) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.MonadSTM.StrictMVar

Methods

noThunks ∷ Context → StrictMVar IO a → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → StrictMVar IO a → IO (Maybe ThunkInfo) #

showTypeOfProxy (StrictMVar IO a) → String #

castStrictMVar ∷ (TMVar m ~ TMVar n, TVar m ~ TVar n) ⇒ StrictMVar m a → StrictMVar n a Source #

takeMVarMonadSTM m ⇒ StrictMVar m a → m a Source #

tryTakeMVarMonadSTM 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 #

readMVarMonadSTM m ⇒ StrictMVar m a → m a Source #

tryReadMVarMonadSTM m ⇒ StrictMVar m a → m (Maybe a) Source #

readMVarSTMMonadSTM 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.

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 ∷ TypeType) = (stm ∷ TypeType) | stm → m #

Instances

Instances details
type STM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM IO = STM
type STM (WithEarlyExit m) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.EarlyExit

type STM (ExceptT e m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (ExceptT e m) = WrappedSTM 'Except e m
type STM (ReaderT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (ReaderT r m) = WrappedSTM 'Reader r m
type STM (StateT s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (StateT s m) = WrappedSTM 'State s m
type STM (WriterT w m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (WriterT w m) = WrappedSTM 'Writer w m
type STM (ContT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (ContT r m) = WrappedSTM 'Cont r m
type STM (RWST r w s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

type STM (RWST r w s m) = WrappedSTM 'RWS (r, w, s) m

throwSTM ∷ ∀ (m ∷ TypeType) e a. (MonadSTM m, MonadThrow (STM m), Exception e) ⇒ e → STM m a #

type family InspectMonad (m ∷ TypeType) ∷ TypeType #

Instances

Instances details
type InspectMonad IO 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

class (MonadSTM m, Monad (InspectMonad m)) ⇒ MonadInspectSTM (m ∷ TypeType) where #

Associated Types

type InspectMonad (m ∷ TypeType) ∷ TypeType #

Methods

inspectTVar ∷ proxy m → TVar m a → InspectMonad m a #

inspectTMVar ∷ proxy m → TMVar m a → InspectMonad m (Maybe a) #

Instances

Instances details
MonadInspectSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type InspectMonad IOTypeType #

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 ∷ TypeType) #

Minimal complete definition

labelTVar

Instances

Instances details
MonadLabelledSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

labelTVar ∷ TVar IO a → StringSTM IO ()

labelTMVar ∷ TMVar IO a → StringSTM IO ()

labelTQueue ∷ TQueue IO a → StringSTM IO ()

labelTBQueue ∷ TBQueue IO a → StringSTM IO ()

labelTArray ∷ (Ix i, Show i) ⇒ TArray IO i e → StringSTM IO ()

labelTSem ∷ TSem IOStringSTM IO ()

labelTChan ∷ TChan IO a → StringSTM IO ()

labelTVarIO ∷ TVar IO a → StringIO ()

labelTMVarIO ∷ TMVar IO a → StringIO ()

labelTQueueIO ∷ TQueue IO a → StringIO ()

labelTBQueueIO ∷ TBQueue IO a → StringIO ()

labelTArrayIO ∷ (Ix i, Show i) ⇒ TArray IO i e → StringIO ()

labelTSemIO ∷ TSem IOStringIO ()

labelTChanIO ∷ TChan IO a → StringIO ()

class (Monad m, Alternative (STM m), MonadPlus (STM m)) ⇒ MonadSTM (m ∷ TypeType) where #

Minimal complete definition

atomically, newTVar, readTVar, writeTVar, retry, orElse

Associated Types

type STM (m ∷ TypeType) = (stm ∷ TypeType) | stm → m #

Methods

atomicallyHasCallStackSTM m a → m a #

retrySTM m a #

orElseSTM m a → STM m a → STM m a #

checkBoolSTM m () #

Instances

Instances details
MonadSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM IO = (stm ∷ TypeType) #

type TVar IOTypeType

type TMVar IOTypeType

type TQueue IOTypeType

type TBQueue IOTypeType

type TArray IOTypeTypeType

type TSem IO

type TChan IOTypeType

Methods

atomicallyHasCallStackSTM 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 ()

retrySTM IO a #

orElseSTM 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

checkBoolSTM IO () #

newTMVar ∷ a → STM IO (TMVar IO a)

newEmptyTMVarSTM 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

newTQueueSTM 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 ()

newTBQueueNaturalSTM 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 ()

newTSemIntegerSTM IO (TSem IO)

waitTSem ∷ TSem IOSTM IO ()

signalTSem ∷ TSem IOSTM IO ()

signalTSemNNatural → TSem IOSTM IO ()

newTChanSTM IO (TChan IO a)

newBroadcastTChanSTM 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)

newEmptyTMVarIOIO (TMVar IO a)

newTQueueIOIO (TQueue IO a)

newTBQueueIONaturalIO (TBQueue IO a)

newTChanIOIO (TChan IO a)

newBroadcastTChanIOIO (TChan IO a)

MonadSTM m ⇒ MonadSTM (WithEarlyExit m) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.EarlyExit

Associated Types

type STM (WithEarlyExit m) = (stm ∷ TypeType) #

type TVar (WithEarlyExit m) ∷ TypeType

type TMVar (WithEarlyExit m) ∷ TypeType

type TQueue (WithEarlyExit m) ∷ TypeType

type TBQueue (WithEarlyExit m) ∷ TypeType

type TArray (WithEarlyExit m) ∷ TypeTypeType

type TSem (WithEarlyExit m)

type TChan (WithEarlyExit m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (WithEarlyExit m) a #

orElseSTM (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

checkBoolSTM (WithEarlyExit m) () #

newTMVar ∷ a → STM (WithEarlyExit m) (TMVar (WithEarlyExit m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (WithEarlyExit m) (TSem (WithEarlyExit m))

waitTSem ∷ TSem (WithEarlyExit m) → STM (WithEarlyExit m) ()

signalTSem ∷ TSem (WithEarlyExit m) → STM (WithEarlyExit m) ()

signalTSemNNatural → TSem (WithEarlyExit m) → STM (WithEarlyExit m) ()

newTChanSTM (WithEarlyExit m) (TChan (WithEarlyExit m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOWithEarlyExit m (TMVar (WithEarlyExit m) a)

newTQueueIOWithEarlyExit m (TQueue (WithEarlyExit m) a)

newTBQueueIONaturalWithEarlyExit m (TBQueue (WithEarlyExit m) a)

newTChanIOWithEarlyExit m (TChan (WithEarlyExit m) a)

newBroadcastTChanIOWithEarlyExit m (TChan (WithEarlyExit m) a)

MonadSTM m ⇒ MonadSTM (ExceptT e m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (ExceptT e m) = (stm ∷ TypeType) #

type TVar (ExceptT e m) ∷ TypeType

type TMVar (ExceptT e m) ∷ TypeType

type TQueue (ExceptT e m) ∷ TypeType

type TBQueue (ExceptT e m) ∷ TypeType

type TArray (ExceptT e m) ∷ TypeTypeType

type TSem (ExceptT e m)

type TChan (ExceptT e m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (ExceptT e m) a #

orElseSTM (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

checkBoolSTM (ExceptT e m) () #

newTMVar ∷ a → STM (ExceptT e m) (TMVar (ExceptT e m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (ExceptT e m) → STM (ExceptT e m) ()

newTChanSTM (ExceptT e m) (TChan (ExceptT e m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOExceptT e m (TMVar (ExceptT e m) a)

newTQueueIOExceptT e m (TQueue (ExceptT e m) a)

newTBQueueIONaturalExceptT e m (TBQueue (ExceptT e m) a)

newTChanIOExceptT e m (TChan (ExceptT e m) a)

newBroadcastTChanIOExceptT e m (TChan (ExceptT e m) a)

MonadSTM m ⇒ MonadSTM (ReaderT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (ReaderT r m) = (stm ∷ TypeType) #

type TVar (ReaderT r m) ∷ TypeType

type TMVar (ReaderT r m) ∷ TypeType

type TQueue (ReaderT r m) ∷ TypeType

type TBQueue (ReaderT r m) ∷ TypeType

type TArray (ReaderT r m) ∷ TypeTypeType

type TSem (ReaderT r m)

type TChan (ReaderT r m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (ReaderT r m) a #

orElseSTM (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

checkBoolSTM (ReaderT r m) () #

newTMVar ∷ a → STM (ReaderT r m) (TMVar (ReaderT r m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (ReaderT r m) → STM (ReaderT r m) ()

newTChanSTM (ReaderT r m) (TChan (ReaderT r m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOReaderT r m (TMVar (ReaderT r m) a)

newTQueueIOReaderT r m (TQueue (ReaderT r m) a)

newTBQueueIONaturalReaderT r m (TBQueue (ReaderT r m) a)

newTChanIOReaderT r m (TChan (ReaderT r m) a)

newBroadcastTChanIOReaderT r m (TChan (ReaderT r m) a)

MonadSTM m ⇒ MonadSTM (StateT s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (StateT s m) = (stm ∷ TypeType) #

type TVar (StateT s m) ∷ TypeType

type TMVar (StateT s m) ∷ TypeType

type TQueue (StateT s m) ∷ TypeType

type TBQueue (StateT s m) ∷ TypeType

type TArray (StateT s m) ∷ TypeTypeType

type TSem (StateT s m)

type TChan (StateT s m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (StateT s m) a #

orElseSTM (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

checkBoolSTM (StateT s m) () #

newTMVar ∷ a → STM (StateT s m) (TMVar (StateT s m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (StateT s m) → STM (StateT s m) ()

newTChanSTM (StateT s m) (TChan (StateT s m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOStateT s m (TMVar (StateT s m) a)

newTQueueIOStateT s m (TQueue (StateT s m) a)

newTBQueueIONaturalStateT s m (TBQueue (StateT s m) a)

newTChanIOStateT s m (TChan (StateT s m) a)

newBroadcastTChanIOStateT s m (TChan (StateT s m) a)

(Monoid w, MonadSTM m) ⇒ MonadSTM (WriterT w m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (WriterT w m) = (stm ∷ TypeType) #

type TVar (WriterT w m) ∷ TypeType

type TMVar (WriterT w m) ∷ TypeType

type TQueue (WriterT w m) ∷ TypeType

type TBQueue (WriterT w m) ∷ TypeType

type TArray (WriterT w m) ∷ TypeTypeType

type TSem (WriterT w m)

type TChan (WriterT w m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (WriterT w m) a #

orElseSTM (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

checkBoolSTM (WriterT w m) () #

newTMVar ∷ a → STM (WriterT w m) (TMVar (WriterT w m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (WriterT w m) → STM (WriterT w m) ()

newTChanSTM (WriterT w m) (TChan (WriterT w m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOWriterT w m (TMVar (WriterT w m) a)

newTQueueIOWriterT w m (TQueue (WriterT w m) a)

newTBQueueIONaturalWriterT w m (TBQueue (WriterT w m) a)

newTChanIOWriterT w m (TChan (WriterT w m) a)

newBroadcastTChanIOWriterT w m (TChan (WriterT w m) a)

MonadSTM m ⇒ MonadSTM (ContT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (ContT r m) = (stm ∷ TypeType) #

type TVar (ContT r m) ∷ TypeType

type TMVar (ContT r m) ∷ TypeType

type TQueue (ContT r m) ∷ TypeType

type TBQueue (ContT r m) ∷ TypeType

type TArray (ContT r m) ∷ TypeTypeType

type TSem (ContT r m)

type TChan (ContT r m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (ContT r m) a #

orElseSTM (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

checkBoolSTM (ContT r m) () #

newTMVar ∷ a → STM (ContT r m) (TMVar (ContT r m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (ContT r m) → STM (ContT r m) ()

newTChanSTM (ContT r m) (TChan (ContT r m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIOContT r m (TMVar (ContT r m) a)

newTQueueIOContT r m (TQueue (ContT r m) a)

newTBQueueIONaturalContT r m (TBQueue (ContT r m) a)

newTChanIOContT r m (TChan (ContT r m) a)

newBroadcastTChanIOContT r m (TChan (ContT r m) a)

(Monoid w, MonadSTM m) ⇒ MonadSTM (RWST r w s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Associated Types

type STM (RWST r w s m) = (stm ∷ TypeType) #

type TVar (RWST r w s m) ∷ TypeType

type TMVar (RWST r w s m) ∷ TypeType

type TQueue (RWST r w s m) ∷ TypeType

type TBQueue (RWST r w s m) ∷ TypeType

type TArray (RWST r w s m) ∷ TypeTypeType

type TSem (RWST r w s m)

type TChan (RWST r w s m) ∷ TypeType

Methods

atomicallyHasCallStackSTM (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) ()

retrySTM (RWST r w s m) a #

orElseSTM (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

checkBoolSTM (RWST r w s m) () #

newTMVar ∷ a → STM (RWST r w s m) (TMVar (RWST r w s m) a)

newEmptyTMVarSTM (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

newTQueueSTM (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) ()

newTBQueueNaturalSTM (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) ()

newTSemIntegerSTM (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) ()

signalTSemNNatural → TSem (RWST r w s m) → STM (RWST r w s m) ()

newTChanSTM (RWST r w s m) (TChan (RWST r w s m) a)

newBroadcastTChanSTM (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)

newEmptyTMVarIORWST r w s m (TMVar (RWST r w s m) a)

newTQueueIORWST r w s m (TQueue (RWST r w s m) a)

newTBQueueIONaturalRWST r w s m (TBQueue (RWST r w s m) a)

newTChanIORWST r w s m (TChan (RWST r w s m) a)

newBroadcastTChanIORWST r w s m (TChan (RWST r w s m) a)

class MonadInspectSTM m ⇒ MonadTraceSTM (m ∷ TypeType) #

Minimal complete definition

traceTVar, traceTQueue, traceTBQueue

Instances

Instances details
MonadTraceSTM IO 
Instance details

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 IntegerIntegerInspectMonad 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 IntegerIntegerInspectMonad IO TraceValue) → IO ()

data TraceValue where #

Constructors

TraceValue 

Fields

Bundled Patterns

pattern TraceStringStringTraceValue 
pattern DontTraceTraceValue 
pattern TraceDynamic ∷ () ⇒ Typeable tr ⇒ tr → TraceValue 

newtype WrappedSTM (t ∷ Trans) r (m ∷ TypeType) a #

Constructors

WrappedSTM 

Fields

Instances

Instances details
(MonadSTM m, MArray e a (STM m)) ⇒ MArray e a (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

getBoundsIx i ⇒ e i a → WrappedSTM t r m (i, i) Source #

getNumElementsIx i ⇒ e i a → WrappedSTM t r m Int

newArrayIx i ⇒ (i, i) → a → WrappedSTM t r m (e i a) Source #

newArray_Ix i ⇒ (i, i) → WrappedSTM t r m (e i a) Source #

unsafeNewArray_Ix i ⇒ (i, i) → WrappedSTM t r m (e i a)

unsafeReadIx i ⇒ e i a → IntWrappedSTM t r m a

unsafeWriteIx i ⇒ e i a → Int → a → WrappedSTM t r m ()

MonadSTM m ⇒ Monad (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

(>>=)WrappedSTM t r m a → (a → WrappedSTM t r m b) → WrappedSTM t r m b Source #

(>>)WrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m b Source #

return ∷ a → WrappedSTM t r m a Source #

MonadSTM m ⇒ Functor (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

fmap ∷ (a → b) → WrappedSTM t r m a → WrappedSTM t r m b Source #

(<$) ∷ a → WrappedSTM t r m b → WrappedSTM t r m a Source #

MonadSTM m ⇒ Applicative (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

pure ∷ a → WrappedSTM t r m a Source #

(<*>)WrappedSTM t r m (a → b) → WrappedSTM t r m a → WrappedSTM t r m b Source #

liftA2 ∷ (a → b → c) → WrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m c Source #

(*>)WrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m b Source #

(<*)WrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m a Source #

MonadSTM m ⇒ Alternative (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

emptyWrappedSTM t r m a Source #

(<|>)WrappedSTM t r m a → WrappedSTM t r m a → WrappedSTM t r m a Source #

someWrappedSTM t r m a → WrappedSTM t r m [a] Source #

manyWrappedSTM t r m a → WrappedSTM t r m [a] Source #

MonadSTM m ⇒ MonadPlus (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

mzeroWrappedSTM t r m a Source #

mplusWrappedSTM t r m a → WrappedSTM t r m a → WrappedSTM t r m a Source #

(MonadSTM m, MonadThrow (STM m), MonadCatch (STM m)) ⇒ MonadCatch (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

catchException e ⇒ WrappedSTM t r m a → (e → WrappedSTM t r m a) → WrappedSTM t r m a #

catchJustException e ⇒ (e → Maybe b) → WrappedSTM t r m a → (b → WrappedSTM t r m a) → WrappedSTM t r m a #

tryException e ⇒ WrappedSTM t r m a → WrappedSTM t r m (Either e a) #

tryJustException e ⇒ (e → Maybe b) → WrappedSTM t r m a → WrappedSTM t r m (Either b a) #

handleException e ⇒ (e → WrappedSTM t r m a) → WrappedSTM t r m a → WrappedSTM t r m a #

handleJustException e ⇒ (e → Maybe b) → (b → WrappedSTM t r m a) → WrappedSTM t r m a → WrappedSTM t r m a #

onExceptionWrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m a #

bracketOnErrorWrappedSTM t r m a → (a → WrappedSTM t r m b) → (a → WrappedSTM t r m c) → WrappedSTM t r m c #

generalBracketWrappedSTM t r m a → (a → ExitCase b → WrappedSTM t r m c) → (a → WrappedSTM t r m b) → WrappedSTM t r m (b, c) #

(MonadSTM m, MonadThrow (STM m), MonadCatch (STM m)) ⇒ MonadThrow (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

throwIOException e ⇒ e → WrappedSTM t r m a #

bracketWrappedSTM t r m a → (a → WrappedSTM t r m b) → (a → WrappedSTM t r m c) → WrappedSTM t r m c #

bracket_WrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m c → WrappedSTM t r m c #

finallyWrappedSTM t r m a → WrappedSTM t r m b → WrappedSTM t r m a #

(Semigroup a, MonadSTM m) ⇒ Semigroup (WrappedSTM t r m a) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

(<>)WrappedSTM t r m a → WrappedSTM t r m a → WrappedSTM t r m a Source #

sconcatNonEmpty (WrappedSTM t r m a) → WrappedSTM t r m a Source #

stimesIntegral b ⇒ b → WrappedSTM t r m a → WrappedSTM t r m a Source #

(Monoid a, MonadSTM m) ⇒ Monoid (WrappedSTM t r m a) 
Instance details

Defined in Control.Monad.Class.MonadSTM.Internal

Methods

memptyWrappedSTM t r m a Source #

mappendWrappedSTM t r m a → WrappedSTM t r m a → WrappedSTM t r m a Source #

mconcat ∷ [WrappedSTM t r m a] → WrappedSTM t r m a Source #

castStrictTVar ∷ ∀ (m ∷ TypeType) (n ∷ TypeType) a. LazyTVar m ~ LazyTVar n ⇒ StrictTVar m a → StrictTVar n a #

fromLazyTVar ∷ ∀ (m ∷ TypeType) a. LazyTVar m a → StrictTVar m a #

labelTVar ∷ ∀ (m ∷ TypeType) a. MonadLabelledSTM m ⇒ StrictTVar m a → StringSTM m () #

labelTVarIOMonadLabelledSTM m ⇒ StrictTVar m a → String → m () #

modifyTVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTVar m a → (a → a) → STM m () #

newTVarMMonadSTM m ⇒ a → m (StrictTVar m a) #

newTVarWithInvariant ∷ ∀ (m ∷ TypeType) 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 ∷ TypeType) a. MonadSTM m ⇒ StrictTVar m a → STM m a #

readTVarIOMonadSTM m ⇒ StrictTVar m a → m a #

stateTVar ∷ ∀ (m ∷ TypeType) s a. MonadSTM m ⇒ StrictTVar m s → (s → (a, s)) → STM m a #

swapTVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTVar m a → a → STM m a #

toLazyTVar ∷ ∀ (m ∷ TypeType) a. StrictTVar m a → LazyTVar m a #

traceTVar ∷ ∀ (m ∷ TypeType) proxy a. MonadTraceSTM m ⇒ proxy m → StrictTVar m a → (Maybe a → a → InspectMonad m TraceValue) → STM m () #

traceTVarIOMonadTraceSTM m ⇒ StrictTVar m a → (Maybe a → a → InspectMonad m TraceValue) → m () #

updateTVar ∷ ∀ (m ∷ TypeType) s a. MonadSTM m ⇒ StrictTVar m s → (s → (a, s)) → STM m a #

writeTVar ∷ ∀ (m ∷ TypeType) a. (MonadSTM m, HasCallStack) ⇒ StrictTVar m a → a → STM m () #

type LazyTVar (m ∷ TypeType) = TVar m #

data StrictTVar (m ∷ TypeType) a #

Instances

Instances details
NoThunks a ⇒ NoThunks (StrictTVar IO a) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.Orphans

Methods

noThunks ∷ Context → StrictTVar IO a → IO (Maybe ThunkInfo) #

wNoThunks ∷ Context → StrictTVar IO a → IO (Maybe ThunkInfo) #

showTypeOfProxy (StrictTVar IO a) → String #

castStrictTMVar ∷ ∀ (m ∷ TypeType) (n ∷ TypeType) a. LazyTMVar m ~ LazyTMVar n ⇒ StrictTMVar m a → StrictTMVar n a #

fromLazyTMVar ∷ ∀ (m ∷ TypeType) a. LazyTMVar m a → StrictTMVar m a #

isEmptyTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → STM m Bool #

labelTMVar ∷ ∀ (m ∷ TypeType) a. MonadLabelledSTM m ⇒ StrictTMVar m a → StringSTM m () #

labelTMVarIOMonadLabelledSTM m ⇒ StrictTMVar m a → String → m () #

newEmptyTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ STM m (StrictTMVar m a) #

newTMVarMMonadSTM m ⇒ a → m (StrictTMVar m a) #

putTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m () #

readTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → STM m a #

swapTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m a #

takeTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → STM m a #

traceTMVar ∷ ∀ (m ∷ TypeType) proxy a. MonadTraceSTM m ⇒ proxy m → StrictTMVar m a → (Maybe (Maybe a) → Maybe a → InspectMonad m TraceValue) → STM m () #

traceTMVarIOMonadTraceSTM m ⇒ StrictTMVar m a → (Maybe (Maybe a) → Maybe a → InspectMonad m TraceValue) → m () #

tryPutTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → a → STM m Bool #

tryReadTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a) #

tryTakeTMVar ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ StrictTMVar m a → STM m (Maybe a) #

type LazyTMVar (m ∷ TypeType) = TMVar m #

data StrictTMVar (m ∷ TypeType) 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

uncheckedNewMVarMonadSTM m ⇒ a → m (StrictMVar m a) Source #

uncheckedNewTVarMMonadSTM m ⇒ a → m (StrictTVar m a) Source #