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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleadjunctions-4.4.4Haskell2010

Control.Monad.Representable.Reader

Representable functors on Hask are all monads, because they are isomorphic to a Reader monad.

Contents
  1. Representable functor monad
  2. Monad Transformer
Synopsis
  • Packageadjunctions-4.4.4
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceReader.hs

Representable functor monad

Monad Transformer

newtypenewtype ReaderT (f :: Type -> Type) (m :: Type -> Type) b
#

Constructors

Instances18MonadReader, MonadWriter, MonadTrans, Monad, Functor, Applicative, …
classclass Monad m => MonadReader r (m :: Type -> Type) | m -> r where

See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.

Methods

  • ask :: m r

    Retrieves the monad environment.

  • local :: (r -> r) -> m a -> m a

    Executes a computation in a modified environment.

  • reader :: (r -> a) -> m a

    Retrieves a function of the current environment.

Instances28MonadReader, …