extensible-effects-1.9.2.2: An Alternative to Monad Transformers

Safe HaskellSafe
LanguageHaskell2010

Control.Eff.Reader.Strict

Description

Strict 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

Functor (Reader e) 
Typeable (* -> * -> *) Reader 

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 admins 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.