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

Ouroboros.Consensus.Util.MonadSTM.NormalForm

Contents

Synopsis

Documentation

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

Instances

Instances details
type STM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

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

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

Defined in Control.Monad.Class.MonadSTM

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

Defined in Control.Monad.Class.MonadSTM

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

Defined in Control.Monad.Class.MonadSTM

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

Defined in Control.Monad.Class.MonadSTM

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

Defined in Control.Monad.Class.MonadSTM

type STM (RWST r w s m) = WrappedSTM 'RWS (r, w, s) 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 #

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

Minimal complete definition

atomically, newTVar, readTVar, writeTVar, retry, orElse, newTMVar, newEmptyTMVar, takeTMVar, tryTakeTMVar, putTMVar, tryPutTMVar, readTMVar, tryReadTMVar, swapTMVar, isEmptyTMVar, newTQueue, readTQueue, tryReadTQueue, peekTQueue, tryPeekTQueue, writeTQueue, isEmptyTQueue, newTBQueue, readTBQueue, tryReadTBQueue, peekTBQueue, tryPeekTBQueue, flushTBQueue, writeTBQueue, lengthTBQueue, isEmptyTBQueue, isFullTBQueue

Associated Types

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

type TQueue (m ∷ TypeType) ∷ TypeType #

type TBQueue (m ∷ TypeType) ∷ TypeType #

Methods

atomicallyHasCallStackSTM m a → m a #

retrySTM m a #

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

modifyTVar' ∷ TVar m a → (a → a) → STM m () #

checkBoolSTM m () #

newTQueueSTM m (TQueue m a) #

readTQueueTQueue m a → STM m a #

tryReadTQueueTQueue m a → STM m (Maybe a) #

peekTQueueTQueue m a → STM m a #

tryPeekTQueueTQueue m a → STM m (Maybe a) #

writeTQueueTQueue m a → a → STM m () #

isEmptyTQueueTQueue m a → STM m Bool #

newTBQueueNaturalSTM m (TBQueue m a) #

readTBQueueTBQueue m a → STM m a #

tryReadTBQueueTBQueue m a → STM m (Maybe a) #

peekTBQueueTBQueue m a → STM m a #

tryPeekTBQueueTBQueue m a → STM m (Maybe a) #

flushTBQueueTBQueue m a → STM m [a] #

writeTBQueueTBQueue m a → a → STM m () #

lengthTBQueueTBQueue m a → STM m Natural #

isEmptyTBQueueTBQueue m a → STM m Bool #

isFullTBQueueTBQueue m a → STM m Bool #

newTQueueIO ∷ m (TQueue m a) #

newTBQueueIONatural → m (TBQueue m a) #

Instances

Instances details
MonadSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

Associated Types

type STM IO = (stm ∷ TypeType) #

type TVar IOTypeType

type TMVar IOTypeType

type TQueue IOTypeType #

type TBQueue 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) #

readTQueueTQueue IO a → STM IO a #

tryReadTQueueTQueue IO a → STM IO (Maybe a) #

peekTQueueTQueue IO a → STM IO a #

tryPeekTQueueTQueue IO a → STM IO (Maybe a) #

writeTQueueTQueue IO a → a → STM IO () #

isEmptyTQueueTQueue IO a → STM IO Bool #

newTBQueueNaturalSTM IO (TBQueue IO a) #

readTBQueueTBQueue IO a → STM IO a #

tryReadTBQueueTBQueue IO a → STM IO (Maybe a) #

peekTBQueueTBQueue IO a → STM IO a #

tryPeekTBQueueTBQueue IO a → STM IO (Maybe a) #

flushTBQueueTBQueue IO a → STM IO [a] #

writeTBQueueTBQueue IO a → a → STM IO () #

lengthTBQueueTBQueue IO a → STM IO Natural #

isEmptyTBQueueTBQueue IO a → STM IO Bool #

isFullTBQueueTBQueue 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) #

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 #

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

readTQueueTQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a #

tryReadTQueueTQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) #

peekTQueueTQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a #

tryPeekTQueueTQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) #

writeTQueueTQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () #

isEmptyTQueueTQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Bool #

newTBQueueNaturalSTM (WithEarlyExit m) (TBQueue (WithEarlyExit m) a) #

readTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a #

tryReadTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) #

peekTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) a #

tryPeekTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) (Maybe a) #

flushTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) [a] #

writeTBQueueTBQueue (WithEarlyExit m) a → a → STM (WithEarlyExit m) () #

lengthTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Natural #

isEmptyTBQueueTBQueue (WithEarlyExit m) a → STM (WithEarlyExit m) Bool #

isFullTBQueueTBQueue (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) #

MonadSTM m ⇒ MonadSTM (ExceptT e m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (ExceptT e m) a → STM (ExceptT e m) a #

tryReadTQueueTQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) #

peekTQueueTQueue (ExceptT e m) a → STM (ExceptT e m) a #

tryPeekTQueueTQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) #

writeTQueueTQueue (ExceptT e m) a → a → STM (ExceptT e m) () #

isEmptyTQueueTQueue (ExceptT e m) a → STM (ExceptT e m) Bool #

newTBQueueNaturalSTM (ExceptT e m) (TBQueue (ExceptT e m) a) #

readTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) a #

tryReadTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) #

peekTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) a #

tryPeekTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) (Maybe a) #

flushTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) [a] #

writeTBQueueTBQueue (ExceptT e m) a → a → STM (ExceptT e m) () #

lengthTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) Natural #

isEmptyTBQueueTBQueue (ExceptT e m) a → STM (ExceptT e m) Bool #

isFullTBQueueTBQueue (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) #

MonadSTM m ⇒ MonadSTM (ReaderT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (ReaderT r m) a → STM (ReaderT r m) a #

tryReadTQueueTQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) #

peekTQueueTQueue (ReaderT r m) a → STM (ReaderT r m) a #

tryPeekTQueueTQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) #

writeTQueueTQueue (ReaderT r m) a → a → STM (ReaderT r m) () #

isEmptyTQueueTQueue (ReaderT r m) a → STM (ReaderT r m) Bool #

newTBQueueNaturalSTM (ReaderT r m) (TBQueue (ReaderT r m) a) #

readTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) a #

tryReadTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) #

peekTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) a #

tryPeekTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) (Maybe a) #

flushTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) [a] #

writeTBQueueTBQueue (ReaderT r m) a → a → STM (ReaderT r m) () #

lengthTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) Natural #

isEmptyTBQueueTBQueue (ReaderT r m) a → STM (ReaderT r m) Bool #

isFullTBQueueTBQueue (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) #

MonadSTM m ⇒ MonadSTM (StateT s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (StateT s m) a → STM (StateT s m) a #

tryReadTQueueTQueue (StateT s m) a → STM (StateT s m) (Maybe a) #

peekTQueueTQueue (StateT s m) a → STM (StateT s m) a #

tryPeekTQueueTQueue (StateT s m) a → STM (StateT s m) (Maybe a) #

writeTQueueTQueue (StateT s m) a → a → STM (StateT s m) () #

isEmptyTQueueTQueue (StateT s m) a → STM (StateT s m) Bool #

newTBQueueNaturalSTM (StateT s m) (TBQueue (StateT s m) a) #

readTBQueueTBQueue (StateT s m) a → STM (StateT s m) a #

tryReadTBQueueTBQueue (StateT s m) a → STM (StateT s m) (Maybe a) #

peekTBQueueTBQueue (StateT s m) a → STM (StateT s m) a #

tryPeekTBQueueTBQueue (StateT s m) a → STM (StateT s m) (Maybe a) #

flushTBQueueTBQueue (StateT s m) a → STM (StateT s m) [a] #

writeTBQueueTBQueue (StateT s m) a → a → STM (StateT s m) () #

lengthTBQueueTBQueue (StateT s m) a → STM (StateT s m) Natural #

isEmptyTBQueueTBQueue (StateT s m) a → STM (StateT s m) Bool #

isFullTBQueueTBQueue (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) #

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

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (WriterT w m) a → STM (WriterT w m) a #

tryReadTQueueTQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) #

peekTQueueTQueue (WriterT w m) a → STM (WriterT w m) a #

tryPeekTQueueTQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) #

writeTQueueTQueue (WriterT w m) a → a → STM (WriterT w m) () #

isEmptyTQueueTQueue (WriterT w m) a → STM (WriterT w m) Bool #

newTBQueueNaturalSTM (WriterT w m) (TBQueue (WriterT w m) a) #

readTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) a #

tryReadTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) #

peekTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) a #

tryPeekTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) (Maybe a) #

flushTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) [a] #

writeTBQueueTBQueue (WriterT w m) a → a → STM (WriterT w m) () #

lengthTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) Natural #

isEmptyTBQueueTBQueue (WriterT w m) a → STM (WriterT w m) Bool #

isFullTBQueueTBQueue (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) #

MonadSTM m ⇒ MonadSTM (ContT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (ContT r m) a → STM (ContT r m) a #

tryReadTQueueTQueue (ContT r m) a → STM (ContT r m) (Maybe a) #

peekTQueueTQueue (ContT r m) a → STM (ContT r m) a #

tryPeekTQueueTQueue (ContT r m) a → STM (ContT r m) (Maybe a) #

writeTQueueTQueue (ContT r m) a → a → STM (ContT r m) () #

isEmptyTQueueTQueue (ContT r m) a → STM (ContT r m) Bool #

newTBQueueNaturalSTM (ContT r m) (TBQueue (ContT r m) a) #

readTBQueueTBQueue (ContT r m) a → STM (ContT r m) a #

tryReadTBQueueTBQueue (ContT r m) a → STM (ContT r m) (Maybe a) #

peekTBQueueTBQueue (ContT r m) a → STM (ContT r m) a #

tryPeekTBQueueTBQueue (ContT r m) a → STM (ContT r m) (Maybe a) #

flushTBQueueTBQueue (ContT r m) a → STM (ContT r m) [a] #

writeTBQueueTBQueue (ContT r m) a → a → STM (ContT r m) () #

lengthTBQueueTBQueue (ContT r m) a → STM (ContT r m) Natural #

isEmptyTBQueueTBQueue (ContT r m) a → STM (ContT r m) Bool #

isFullTBQueueTBQueue (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) #

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

Defined in Control.Monad.Class.MonadSTM

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 #

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

readTQueueTQueue (RWST r w s m) a → STM (RWST r w s m) a #

tryReadTQueueTQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) #

peekTQueueTQueue (RWST r w s m) a → STM (RWST r w s m) a #

tryPeekTQueueTQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) #

writeTQueueTQueue (RWST r w s m) a → a → STM (RWST r w s m) () #

isEmptyTQueueTQueue (RWST r w s m) a → STM (RWST r w s m) Bool #

newTBQueueNaturalSTM (RWST r w s m) (TBQueue (RWST r w s m) a) #

readTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) a #

tryReadTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) #

peekTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) a #

tryPeekTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) (Maybe a) #

flushTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) [a] #

writeTBQueueTBQueue (RWST r w s m) a → a → STM (RWST r w s m) () #

lengthTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) Natural #

isEmptyTBQueueTBQueue (RWST r w s m) a → STM (RWST r w s m) Bool #

isFullTBQueueTBQueue (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) #

type family TBQueue (m ∷ TypeType) ∷ TypeType #

Instances

Instances details
type TBQueue IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (WithEarlyExit m) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.EarlyExit

type TBQueue (ExceptT e m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (ExceptT e m) = TBQueue m
type TBQueue (ReaderT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (ReaderT r m) = TBQueue m
type TBQueue (StateT s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (StateT s m) = TBQueue m
type TBQueue (WriterT w m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (WriterT w m) = TBQueue m
type TBQueue (ContT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (ContT r m) = TBQueue m
type TBQueue (RWST r w s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TBQueue (RWST r w s m) = TBQueue m

type family TQueue (m ∷ TypeType) ∷ TypeType #

Instances

Instances details
type TQueue IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (WithEarlyExit m) Source # 
Instance details

Defined in Ouroboros.Consensus.Util.EarlyExit

type TQueue (ExceptT e m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (ExceptT e m) = TQueue m
type TQueue (ReaderT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (ReaderT r m) = TQueue m
type TQueue (StateT s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (StateT s m) = TQueue m
type TQueue (WriterT w m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (WriterT w m) = TQueue m
type TQueue (ContT r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (ContT r m) = TQueue m
type TQueue (RWST r w s m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

type TQueue (RWST r w s m) = TQueue m

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

flushTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m [a] #

isEmptyTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m Bool #

isEmptyTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → STM m Bool #

isEmptyTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → STM m Bool #

isFullTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m Bool #

labelTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadLabelledSTM m ⇒ TBQueueDefault m a → StringSTM m () #

labelTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadLabelledSTM m ⇒ TMVarDefault m a → StringSTM m () #

labelTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadLabelledSTM m ⇒ TQueueDefault m a → StringSTM m () #

lengthTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m Natural #

newEmptyTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ STM m (TMVarDefault m a) #

newTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ NaturalSTM m (TBQueueDefault m a) #

newTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ a → STM m (TMVarDefault m a) #

newTMVarIODefaultMonadSTM m ⇒ a → m (TMVarDefault m a) #

newTMVarMDefaultMonadSTM m ⇒ a → m (TMVarDefault m a) #

newTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ STM m (TQueueDefault m a) #

peekTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m a #

peekTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → STM m a #

putTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → a → STM m () #

readTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m a #

readTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → STM m a #

readTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → STM m a #

swapTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → a → STM m a #

takeTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → STM m a #

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

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

tryPeekTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m (Maybe a) #

tryPeekTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → STM m (Maybe a) #

tryPutTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → a → STM m Bool #

tryReadTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → STM m (Maybe a) #

tryReadTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → STM m (Maybe a) #

tryReadTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → STM m (Maybe a) #

tryTakeTMVarDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TMVarDefault m a → STM m (Maybe a) #

writeTBQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TBQueueDefault m a → a → STM m () #

writeTQueueDefault ∷ ∀ (m ∷ TypeType) a. MonadSTM m ⇒ TQueueDefault m a → a → STM m () #

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

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

type family InspectMonad (m ∷ TypeType) ∷ TypeType #

Instances

Instances details
type InspectMonad IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

class MonadSTM m ⇒ MonadLabelledSTM (m ∷ TypeType) where #

Minimal complete definition

labelTVar, labelTMVar, labelTQueue, labelTBQueue

Methods

labelTQueueTQueue m a → StringSTM m () #

labelTBQueueTBQueue m a → StringSTM m () #

labelTQueueIOTQueue m a → String → m () #

labelTBQueueIOTBQueue m a → String → m () #

Instances

Instances details
MonadLabelledSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

Methods

labelTVar ∷ TVar IO a → StringSTM IO ()

labelTMVar ∷ TMVar IO a → StringSTM IO ()

labelTQueueTQueue IO a → StringSTM IO () #

labelTBQueueTBQueue IO a → StringSTM IO () #

labelTVarIO ∷ TVar IO a → StringIO ()

labelTMVarIO ∷ TMVar IO a → StringIO ()

labelTQueueIOTQueue IO a → StringIO () #

labelTBQueueIOTBQueue IO a → StringIO () #

class MonadInspectSTM m ⇒ MonadTraceSTM (m ∷ TypeType) where #

Minimal complete definition

traceTVar, traceTQueue, traceTBQueue

Methods

traceTQueue ∷ proxy m → TQueue m a → (Maybe [a] → [a] → InspectMonad m TraceValue) → STM m () #

traceTBQueue ∷ proxy m → TBQueue m a → (Maybe [a] → [a] → InspectMonad m TraceValue) → STM m () #

traceTQueueIO ∷ proxy m → TQueue m a → (Maybe [a] → [a] → InspectMonad m TraceValue) → m () #

traceTBQueueIO ∷ proxy m → TBQueue m a → (Maybe [a] → [a] → InspectMonad m TraceValue) → m () #

Instances

Instances details
MonadTraceSTM IO 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 IOTQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → STM IO () #

traceTBQueue ∷ proxy IOTBQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → STM IO () #

traceTVarIO ∷ proxy IO → TVar IO a → (Maybe a → a → InspectMonad IO TraceValue) → IO ()

traceTMVarIO ∷ proxy IO → TMVar IO a → (Maybe (Maybe a) → Maybe a → InspectMonad IO TraceValue) → IO ()

traceTQueueIO ∷ proxy IOTQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → IO () #

traceTBQueueIO ∷ proxy IOTBQueue IO a → (Maybe [a] → [a] → InspectMonad IO TraceValue) → IO () #

data TBQueueDefault (m ∷ TypeType) a #

Constructors

TBQueue !(TVar m Natural) !(TVar m [a]) !(TVar m Natural) !(TVar m [a]) !Natural 

data TMVarDefault (m ∷ TypeType) a #

data TQueueDefault (m ∷ TypeType) a #

Constructors

TQueue !(TVar m [a]) !(TVar m [a]) 

data TraceValue where #

Constructors

TraceValue 

Fields

Bundled Patterns

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

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

Constructors

WrappedSTM 

Fields

Instances

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

Defined in Control.Monad.Class.MonadSTM

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

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

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

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

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)) ⇒ MonadThrow (WrappedSTM t r m) 
Instance details

Defined in Control.Monad.Class.MonadSTM

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 #

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

Defined in Control.Monad.Class.MonadSTM

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

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

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

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

fromLazyTVar ∷ ∀ (m ∷ TypeType) a. LazyTVar m a → StrictTVar 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 () #

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

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

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

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

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

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

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

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

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

toLazyTVar ∷ ∀ (m ∷ TypeType) a. StrictTVar m a → LazyTVar 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 ⇒ proxy m → StrictTMVar m a → (Maybe (Maybe a) → Maybe a → InspectMonad m TraceValue) → m () #

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

traceTVarIOMonadTraceSTM m ⇒ proxy m → StrictTVar m a → (Maybe a → 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) #

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 LazyTMVar (m ∷ TypeType) = TMVar m #

type LazyTVar (m ∷ TypeType) = TVar m #

data StrictTMVar (m ∷ TypeType) a #

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 #

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 #