effect-handlers-0.1.0.4: A library for writing extensible algebraic effects and handlers. Similar to extensible-effects but with deep handlers.

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Reader

Synopsis

Documentation

newtype Reader w a Source

The functor representing the effect. You shouldn't need to create this manually, just use ask or reader

Constructors

Reader (w -> a) 

Instances

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

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

Get the value from the reader

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

Lift a function into a reader.

readerHandler :: w -> Handler (Reader w) r a a Source

The obvious handler that just embeds the value provided.