effin- A Typeable-free implementation of extensible effects

Safe HaskellNone




type EffectReader r es = (Member (Reader r) es, r ~ ReaderType es) Source

data Reader r a Source

An effect that describes an implicit environment.


runReader :: r -> Effect (Reader r : es) a -> Effect es a Source

Completely handes a Reader effect by providing an environment value to be used throughout the computation.

ask :: EffectReader r es => Effect es r Source

Retrieves the current environment.

asks :: EffectReader r es => (r -> a) -> Effect es a Source

Retrieves a value that is a function of the current environment.

local :: EffectReader r es => (r -> r) -> Effect es a -> Effect es a Source

Runs a computation with a modified environment.