Functor Laws, applicative laws, and monad Laws #
@[simp]
theorem
ExceptT.run_mk
{α : Type u}
{ε : Type u}
{m : Type u → Type v}
(x : m (Except ε α))
:
(ExceptT.mk x).run = x
Equations
- ReaderT.mk f = f
Instances For
@[simp]
theorem
ReaderT.run_mk
{m : Type u → Type v}
{α : Type u}
{σ : Type u}
(f : σ → m α)
(r : σ)
:
(ReaderT.mk f).run r = f r
@[simp]
theorem
OptionT.run_mk
{α : Type u}
{m : Type u → Type v}
(x : m (Option α))
:
(OptionT.mk x).run = x
@[simp]
theorem
OptionT.run_map
{α : Type u}
{β : Type u}
{m : Type u → Type v}
(x : OptionT m α)
[Monad m]
(f : α → β)
[LawfulMonad m]
:
(f <$> x).run = Option.map f <$> x.run
instance
instLawfulMonadOptionT_mathlib
(m : Type u → Type v)
[Monad m]
[LawfulMonad m]
:
LawfulMonad (OptionT m)
Equations
- ⋯ = ⋯
Lawfulness of IO
#
At some point core intends to make IO
opaque, which would break these proofs
As discussed in https://github.com/leanprover/std4/pull/416,
it should be possible for core to expose the lawfulness of IO
as part of the opaque interface,
which would remove the need for these proofs anyway.
These are not in Batteries because Batteries does not want to deal with the churn from such a core refactor.
Equations
Equations
- ⋯ = ⋯