mini-1.3.0.1: Minimal essentials
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mini.Transformers.ReaderT

Description

Extend a monad with a read-only environment

Synopsis

Type

newtype ReaderT r m a Source #

A transformer with read-only r, inner monad m, return a

Constructors

ReaderT (r -> m a) 

Instances

Instances details
MonadTrans (ReaderT r) Source # 
Instance details

Defined in Mini.Transformers.ReaderT

Methods

lift :: Monad m => m a -> ReaderT r m a Source #

(Monad m, Alternative m) => Alternative (ReaderT r m) Source # 
Instance details

Defined in Mini.Transformers.ReaderT

Methods

empty :: ReaderT r m a #

(<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a #

some :: ReaderT r m a -> ReaderT r m [a] #

many :: ReaderT r m a -> ReaderT r m [a] #

Monad m => Applicative (ReaderT r m) Source # 
Instance details

Defined in Mini.Transformers.ReaderT

Methods

pure :: a -> ReaderT r m a #

(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b #

liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #

(*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

(<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #

Monad m => Functor (ReaderT r m) Source # 
Instance details

Defined in Mini.Transformers.ReaderT

Methods

fmap :: (a -> b) -> ReaderT r m a -> ReaderT r m b #

(<$) :: a -> ReaderT r m b -> ReaderT r m a #

Monad m => Monad (ReaderT r m) Source # 
Instance details

Defined in Mini.Transformers.ReaderT

Methods

(>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b #

(>>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

return :: a -> ReaderT r m a #

Runner

runReaderT :: ReaderT r m a -> r -> m a Source #

Unwrap a ReaderT computation with an initial read-only value

Operations

ask :: Monad m => ReaderT r m r Source #

Fetch the read-only environment

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

Run a computation in a modified environment