ether-0.4.2.0: 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 :: proxy tag -> (r -> r) -> m a -> m a Source #

Executes a computation in a modified environment.

reader :: proxy tag -> (r -> a) -> m a Source #

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 # 

Methods

ask :: proxy r -> m (t m) Source #

local :: proxy r -> (t m -> t m) -> m a -> m a Source #

reader :: proxy r -> (t m -> a) -> m a Source #

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

Methods

ask :: proxy r -> m (ReaderT k tag r' m) Source #

local :: proxy r -> (ReaderT k tag r' m -> ReaderT k tag r' m) -> m a -> m a Source #

reader :: proxy r -> (ReaderT k tag r' m -> a) -> m a 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.