A monad transformer that equips a monad with a value.
This is a generalization of ReaderT
where the value is not
necessarily directly readable through the monad.
Equations
- Lake.EquipT ρ m α = (ρ → m α)
Instances For
Equations
- Lake.EquipT.instFunctor = { map := fun {α β : Type ?u.31} => Lake.EquipT.map, mapConst := fun {α β : Type ?u.31} => Lake.EquipT.map ∘ Function.const β }
Equations
- Lake.EquipT.instPure = { pure := fun {α : Type ?u.26} => Lake.EquipT.pure }
Equations
- Lake.EquipT.instSeq = { seq := fun {α β : Type ?u.27} => Lake.EquipT.seq }
instance
Lake.EquipT.instApplicative
{ρ : Type u}
{m : Type v → Type w}
[Applicative m]
:
Applicative (EquipT ρ m)
Equations
Equations
- Lake.EquipT.instBind = { bind := fun {α β : Type ?u.27} => Lake.EquipT.bind }
Equations
- Lake.EquipT.instMonadLift = { monadLift := fun {α : Type ?u.21} => Lake.EquipT.lift }
instance
Lake.EquipT.instMonadFunctor
{ρ : Type u}
{m : Type v → Type w}
:
MonadFunctor m (EquipT ρ m)
Equations
- Lake.EquipT.instMonadFunctor = { monadMap := fun {α : Type ?u.26} (f : {β : Type ?u.26} → m β → m β) (x : Lake.EquipT ρ m α) (ctx : ρ) => f (x ctx) }
@[inline]
def
Lake.EquipT.failure
{ρ : Type u}
{m : Type v → Type w}
[Alternative m]
{α : Type v}
:
EquipT ρ m α
Equations
Instances For
@[inline]
Instances For
instance
Lake.EquipT.instAlternative
{ρ : Type u}
{m : Type v → Type w}
[Alternative m]
:
Alternative (EquipT ρ m)
Equations
- Lake.EquipT.instAlternative = Alternative.mk (fun {α : Type ?u.27} => Lake.EquipT.failure) fun {α : Type ?u.27} => Lake.EquipT.orElse
@[inline]
def
Lake.EquipT.throw
{ρ : Type u}
{m : Type v → Type w}
{ε : Type v}
[MonadExceptOf ε m]
{α : Type v}
(e : ε)
:
EquipT ρ m α
Equations
- Lake.EquipT.throw e x✝ = throw e
Instances For
@[inline]
def
Lake.EquipT.tryCatch
{ρ : Type u}
{m : Type v → Type w}
{ε : Type v}
[MonadExceptOf ε m]
{α : Type v}
(self : EquipT ρ m α)
(c : ε → EquipT ρ m α)
:
EquipT ρ m α
Equations
- self.tryCatch c f = tryCatchThe ε (self f) fun (e : ε) => c e f
Instances For
instance
Lake.EquipT.instMonadExceptOf
{ρ : Type u}
{m : Type v → Type w}
(ε : Type v)
[MonadExceptOf ε m]
:
MonadExceptOf ε (EquipT ρ m)
Equations
- Lake.EquipT.instMonadExceptOf ε = { throw := fun {α : Type ?u.32} => Lake.EquipT.throw, tryCatch := fun {α : Type ?u.32} => Lake.EquipT.tryCatch }
@[always_inline]
instance
Lake.EquipT.instMonadFinallyOfMonad
{ρ : Type u}
{m : Type v → Type w}
[MonadFinally m]
[Monad m]
:
MonadFinally (EquipT ρ m)
Equations
- One or more equations did not get rendered due to their size.