extensible-effects-1.11.0.4: An Alternative to Monad Transformers

Safe HaskellSafe
LanguageHaskell2010

Control.Eff.Reader.Lazy

Description

Lazy read-only state

Synopsis

Documentation

newtype Reader e v Source

The request for a value of type e from the current environment. This environment is analogous to a parameter of type e.

Constructors

Reader (e -> v) 

Instances

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

Get the current value from a Reader.

local :: (Typeable e, Member (Reader e) r) => (e -> e) -> Eff r a -> Eff r a Source

Locally rebind the value in the dynamic environment. This function both requests and handles Reader requests.

reader :: (Typeable e, Member (Reader e) r) => (e -> a) -> Eff r a Source

Request the environment value using a transformation function.

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

The handler of Reader requests. The return type shows that all Reader requests are fully handled.