HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

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, …