@[inline]
Read the environment.
$$\text{ask} : \text{ReaderT}\ \rho\ m\ \rho$$
Alias for Lean's read.
Equations
Instances For
@[inline]
def
Control.Monad.Reader.local
{ρ : Type u_1}
{m : Type u_1 → Type u_2}
{α : Type u_1}
(f : ρ → ρ)
(ma : ReaderT ρ m α)
:
ReaderT ρ m α
Run a computation in a modified environment.
$$\text{local}(f, ma) : \text{ReaderT}\ \rho\ m\ \alpha$$
Runs ma with the environment transformed by f.
Alias for Lean's ReaderT.adapt.
Equations
- Control.Monad.Reader.local f ma = ReaderT.adapt f ma
Instances For
@[inline]
def
Control.Monad.Reader.runReaderT
{ρ : Type u_1}
{m : Type u_1 → Type u_2}
{α : Type u_1}
(ma : ReaderT ρ m α)
(env : ρ)
:
m α
Run a ReaderT computation with a given environment.
$$\text{runReaderT}(ma, \rho) : m\ \alpha$$
Alias for ReaderT.run.
Equations
- Control.Monad.Reader.runReaderT ma env = ma.run env
Instances For
@[inline]
Run a Reader computation with a given environment.
$$\text{runReader}(ma, \rho) : \alpha$$
Equations
- Control.Monad.Reader.runReader ma env = ReaderT.run ma env
Instances For
@[inline]
def
Control.Monad.Reader.mapReaderT
{m : Type u_1 → Type u_2}
{n : Type u_1 → Type u_3}
{ρ α β : Type u_1}
(f : m α → n β)
(ma : ReaderT ρ m α)
:
ReaderT ρ n β
Map over the inner monadic computation.
$$\text{mapReaderT}(f, ma) : \text{ReaderT}\ \rho\ n\ \beta$$
where $f : m\ \alpha \to n\ \beta$.
Equations
- Control.Monad.Reader.mapReaderT f ma env = f (ma.run env)
Instances For
ask returns the environment: runReaderT ask env = pure env.
$$\text{runReaderT}(\text{ask}, \rho) = \text{pure}(\rho)$$