@[inline]
def ReaderT.orElse {m : Type u_1 → Type u_2} {ρ α : Type u_1} [Alternative m] (x₁ : ReaderT ρ m α) (x₂ : Unit → ReaderT ρ m α) :
ReaderT ρ m α
Recovers from errors. The same local value is provided to both branches. Typically used via the
<|> operator.
Instances For
@[inline]
Fails with a recoverable error.
Equations
Instances For
@[instance_reducible]
instance ReaderT.instAlternativeOfMonad {m : Type u_1 → Type u_2} {ρ : Type u_1} [Alternative m] [Monad m] :
Alternative (ReaderT ρ m)
Equations
- ReaderT.instAlternativeOfMonad = { toApplicative := ReaderT.instApplicativeOfMonad, failure := fun {α : Type ?u.2} => ReaderT.failure, orElse := fun {α : Type ?u.2} => ReaderT.orElse }
@[instance_reducible]
instance instMonadControlReaderT {m : Type u_1 → Type u_2} {ρ : Type u_1} :
MonadControl m (ReaderT ρ m)
Equations
- One or more equations did not get rendered due to their size.
@[instance_reducible, always_inline]
instance ReaderT.tryFinally {m : Type u_1 → Type u_2} {ρ : Type u_1} [MonadFinally m] :
MonadFinally (ReaderT ρ m)
Equations
- ReaderT.tryFinally = { tryFinally' := fun {α β : Type ?u.2} (x : ReaderT ρ m α) (h : Option α → ReaderT ρ m β) (ctx : ρ) => tryFinally' (x ctx) fun (a? : Option α) => h a? ctx }
@[instance_reducible]
instance instMonadAttachReaderTOfMonad {m : Type u_1 → Type u_2} {ρ : Type u_1} [Monad m] [MonadAttach m] :
MonadAttach (ReaderT ρ m)
Equations
- One or more equations did not get rendered due to their size.