freer-0.2.2.5: Implementation of the Freer Monad

CopyrightAlej Cabrera 2015
LicenseBSD-3
Maintainercpp.cabrera@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Freer.Reader

Description

Composable handler for Reader effects. Handy for encapsulating an environment with immutable state for interpreters.

Using http://okmij.org/ftp/Haskell/extensible/Eff1.hs as a starting point.

Synopsis

Documentation

data Reader e v where Source

Constructors

Reader :: Reader e e 

ask :: Member (Reader e) r => Eff r e Source

Request a value for the environment

runReader :: Eff (Reader e : r) w -> e -> Eff r w Source

Handler for reader effects

local :: forall e a r. Member (Reader e) r => (e -> e) -> Eff r a -> Eff r a Source

Locally rebind the value in the dynamic environment This function is like a relay; it is both an admin for Reader requests, and a requestor of them