HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulecomposite-base-0.8.3.0Haskell2010

Control.Monad.Composite.Context

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

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