HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecomposite-base-0.8.3.0Haskell2010

Control.Monad.Composite.Context

Module with a ReaderT style monad specialized to holding a record.

  • 1 type
  • 1 class
  • 5 values
newtypenewtype ContextT (c :: [Type]) (m :: Type -> Type) a
#

Monad transformer which adds an implicit environment which is a record. Isomorphic to ReaderT (Record c) m.

Constructors

Instances25MonadRWS, MonadError, MonadReader, MonadState, MonadWriter, MonadBase, …
classclass Monad m => MonadContext (c :: [Type]) (m :: Type -> Type) | m -> c where
#

Class of monad (stacks) which have context reading functionality baked in. Similar to Control.Monad.Reader.MonadReader but can coexist with a another monad that provides Control.Monad.Reader.MonadReader and requires the context to be a record.

Methods

  • askContext :: m (Record c)

    Fetch the context record from the environment.

  • localContext :: (Record c -> Record c) -> m a -> m a

    Run some action which has the same type of context with the context modified.

Instances13MonadContext, …