The Exception monad transformer using CPS style.
Equations
- ExceptCpsT ε m α = ((β : Type ?u.27) → (α → m β) → (ε → m β) → m β)
 
Instances For
@[inline]
def
ExceptCpsT.run
{m : Type u → Type u_1}
{ε α : Type u}
[Monad m]
(x : ExceptCpsT ε m α)
 :
m (Except ε α)
Equations
Instances For
@[inline]
def
ExceptCpsT.runK
{m : Type u → Type u_1}
{β ε α : Type u}
(x : ExceptCpsT ε m α)
(s : ε)
(ok : α → m β)
(error : ε → m β)
 :
m β
Equations
- x.runK s ok error = x β ok error
 
Instances For
@[inline]
def
ExceptCpsT.runCatch
{m : Type u_1 → Type u_2}
{α : Type u_1}
[Monad m]
(x : ExceptCpsT α m α)
 :
m α
Instances For
@[always_inline]
Equations
instance
ExceptCpsT.instLawfulMonad
{σ : Type u_1}
{m : Type u_1 → Type u_2}
 :
LawfulMonad (ExceptCpsT σ m)
instance
ExceptCpsT.instMonadExceptOf
{ε : Type u_1}
{m : Type u_1 → Type u_2}
 :
MonadExceptOf ε (ExceptCpsT ε m)
Equations
- One or more equations did not get rendered due to their size.
 
@[inline]
def
ExceptCpsT.lift
{m : Type u_1 → Type u_2}
{α ε : Type u_1}
[Monad m]
(x : m α)
 :
ExceptCpsT ε m α
Equations
- ExceptCpsT.lift x x✝¹ k x✝ = x >>= k
 
Instances For
instance
ExceptCpsT.instMonadLiftOfMonad
{m : Type u_1 → Type u_2}
{σ : Type u_1}
[Monad m]
 :
MonadLift m (ExceptCpsT σ m)
Equations
- ExceptCpsT.instMonadLiftOfMonad = { monadLift := fun {α : Type ?u.24} => ExceptCpsT.lift }
 
instance
ExceptCpsT.instInhabited
{ε : Type u_1}
{m : Type u_1 → Type u_2}
{α : Type u_1}
[Inhabited ε]
 :
Inhabited (ExceptCpsT ε m α)
Equations
- ExceptCpsT.instInhabited = { default := fun (x : Type ?u.32) (x_1 : α → m x) (k₂ : ε → m x) => k₂ default }
 
@[simp]
theorem
ExceptCpsT.run_throw
{m : Type u_1 → Type u_2}
{ε β : Type u_1}
{e : ε}
[Monad m]
 :
(throw e).run = pure (Except.error e)
@[simp]
theorem
ExceptCpsT.run_bind_lift
{m : Type u_1 → Type u_2}
{α ε β : Type u_1}
[Monad m]
(x : m α)
(f : α → ExceptCpsT ε m β)
 :
@[simp]
theorem
ExceptCpsT.runCatch_lift
{m : Type u → Type u_1}
{α : Type u}
[Monad m]
[LawfulMonad m]
(x : m α)
 :
@[simp]
theorem
ExceptCpsT.runCatch_bind_lift
{m : Type u_1 → Type u_2}
{α β : Type u_1}
[Monad m]
(x : m α)
(f : α → ExceptCpsT β m β)
 :