ExceptT #
@[simp]
theorem
ExceptT.run_lift
{m : Type u → Type v}
{α : Type u}
{ε : Type u}
[Monad m]
(x : m α)
:
(ExceptT.lift x).run = Except.ok <$> x
@[simp]
theorem
ExceptT.run_bind_lift
{m : Type u_1 → Type u_2}
{α : Type u_1}
{ε : Type u_1}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : m α)
(f : α → ExceptT ε m β)
:
(ExceptT.lift x >>= f).run = do
let a ← x
(f a).run
@[simp]
theorem
ExceptT.lift_pure
{m : Type u_1 → Type u_2}
{α : Type u_1}
{ε : Type u_1}
[Monad m]
[LawfulMonad m]
(a : α)
:
ExceptT.lift (pure a) = pure a
@[simp]
theorem
ExceptT.run_map
{m : Type u_1 → Type u_2}
{α : Type u_1}
{β : Type u_1}
{ε : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → β)
(x : ExceptT ε m α)
:
(f <$> x).run = Except.map f <$> x.run
theorem
ExceptT.seqLeft_eq
{α : Type u}
{β : Type u}
{ε : Type u}
{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
(x : ExceptT ε m α)
(y : ExceptT ε m β)
:
(SeqLeft.seqLeft x fun (x : Unit) => y) = Seq.seq (Function.const β <$> x) fun (x : Unit) => y
theorem
ExceptT.seqRight_eq
{m : Type u_1 → Type u_2}
{ε : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : ExceptT ε m α)
(y : ExceptT ε m β)
:
(SeqRight.seqRight x fun (x : Unit) => y) = Seq.seq (Function.const α id <$> x) fun (x : Unit) => y
instance
ExceptT.instLawfulMonad
{m : Type u_1 → Type u_2}
{ε : Type u_1}
[Monad m]
[LawfulMonad m]
:
LawfulMonad (ExceptT ε m)
Equations
- ⋯ = ⋯
Except #
Equations
- ⋯ = ⋯
ReaderT #
@[simp]
theorem
ReaderT.run_mapConst
{m : Type u_1 → Type u_2}
{α : Type u_1}
{ρ : Type u_1}
{β : Type u_1}
[Monad m]
(a : α)
(x : ReaderT ρ m β)
(ctx : ρ)
:
(Functor.mapConst a x).run ctx = Functor.mapConst a (x.run ctx)
@[simp]
theorem
ReaderT.run_seqRight
{m : Type u_1 → Type u_2}
{ρ : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
(x : ReaderT ρ m α)
(y : ReaderT ρ m β)
(ctx : ρ)
:
(SeqRight.seqRight x fun (x : Unit) => y).run ctx = SeqRight.seqRight (x.run ctx) fun (x : Unit) => y.run ctx
@[simp]
theorem
ReaderT.run_seqLeft
{m : Type u_1 → Type u_2}
{ρ : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
(x : ReaderT ρ m α)
(y : ReaderT ρ m β)
(ctx : ρ)
:
(SeqLeft.seqLeft x fun (x : Unit) => y).run ctx = SeqLeft.seqLeft (x.run ctx) fun (x : Unit) => y.run ctx
instance
ReaderT.instLawfulFunctor
{m : Type u_1 → Type u_2}
{ρ : Type u_1}
[Monad m]
[LawfulFunctor m]
:
LawfulFunctor (ReaderT ρ m)
Equations
- ⋯ = ⋯
instance
ReaderT.instLawfulApplicative
{m : Type u_1 → Type u_2}
{ρ : Type u_1}
[Monad m]
[LawfulApplicative m]
:
LawfulApplicative (ReaderT ρ m)
Equations
- ⋯ = ⋯
instance
ReaderT.instLawfulMonad
{m : Type u_1 → Type u_2}
{ρ : Type u_1}
[Monad m]
[LawfulMonad m]
:
LawfulMonad (ReaderT ρ m)
Equations
- ⋯ = ⋯
StateRefT #
instance
instLawfulMonadStateRefT'
{m : Type → Type}
{ω : Type}
{σ : Type}
[Monad m]
[LawfulMonad m]
:
LawfulMonad (StateRefT' ω σ m)
Equations
- ⋯ = ⋯
StateT #
@[simp]
theorem
StateT.run_set
{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
(s : σ)
(s' : σ)
:
(set s').run s = pure (PUnit.unit, s')
@[simp]
theorem
StateT.run_modify
{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
(f : σ → σ)
(s : σ)
:
(modify f).run s = pure (PUnit.unit, f s)
@[simp]
theorem
StateT.run_lift
{m : Type u → Type u_1}
{α : Type u}
{σ : Type u}
[Monad m]
(x : m α)
(s : σ)
:
(StateT.lift x).run s = do
let a ← x
pure (a, s)
@[simp]
theorem
StateT.run_bind_lift
{m : Type u → Type u_1}
{β : Type u}
{α : Type u}
{σ : Type u}
[Monad m]
[LawfulMonad m]
(x : m α)
(f : α → StateT σ m β)
(s : σ)
:
(StateT.lift x >>= f).run s = do
let a ← x
(f a).run s
@[simp]
@[simp]
theorem
StateT.run_seqRight
{m : Type u_1 → Type u_2}
{σ : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)
(s : σ)
:
(SeqRight.seqRight x fun (x : Unit) => y).run s = do
let p ← x.run s
y.run p.snd
@[simp]
theorem
StateT.run_seqLeft
{m : Type u → Type u_1}
{α : Type u}
{β : Type u}
{σ : Type u}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)
(s : σ)
:
(SeqLeft.seqLeft x fun (x : Unit) => y).run s = do
let p ← x.run s
let p' ← y.run p.snd
pure (p.fst, p'.snd)
theorem
StateT.seqRight_eq
{m : Type u_1 → Type u_2}
{σ : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)
:
(SeqRight.seqRight x fun (x : Unit) => y) = Seq.seq (Function.const α id <$> x) fun (x : Unit) => y
theorem
StateT.seqLeft_eq
{m : Type u_1 → Type u_2}
{σ : Type u_1}
{α : Type u_1}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(x : StateT σ m α)
(y : StateT σ m β)
:
(SeqLeft.seqLeft x fun (x : Unit) => y) = Seq.seq (Function.const β <$> x) fun (x : Unit) => y
instance
StateT.instLawfulMonad
{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
[LawfulMonad m]
:
LawfulMonad (StateT σ m)
Equations
- ⋯ = ⋯
EStateM #
Equations
- ⋯ = ⋯