effect-handlers-0.1.0.0

Safe HaskellNone
LanguageHaskell2010

Control.Effects.Codt.Reader

Synopsis

Documentation

This module provides the familiar reader effect.

newtype Reader w a

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

Get the value from the reader

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

Lift a function into a reader.

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

The obvious handler that just embeds the value provided.