ether-0.4.0.2: Monad transformers and classes

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Ether.Reader.Class

Description

Synopsis

Documentation

class Monad m => MonadReader tag r m | m tag -> r where Source

Minimal complete definition

(ask | reader), local

Methods

ask :: proxy tag -> m r Source

Retrieves the monad environment.

local Source

Arguments

:: proxy tag 
-> (r -> r)

The function to modify the environment.

-> m a

Reader to run in the modified environment.

-> m a 

Executes a computation in a modified environment.

reader Source

Arguments

:: proxy tag 
-> (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.

Instances

(LiftLocal t, Monad (t m), MonadReader k tag r m) => MonadReader k tag r (t m) Source 
(Monad m, (~) * r r') => MonadReader k tag r (ReaderT k tag r' m) Source 

asks Source

Arguments

:: MonadReader tag r m 
=> proxy tag 
-> (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.