Documentation

Lean.Util.MonadBacktrack

class Lean.MonadBacktrack (s : outParam Type) (m : TypeType) :
Type
  • saveState : m s
  • restoreState : sm Unit

Similar to MonadState, but it retrieves/restores only the "backtrackable" part of the state

Instances
    @[specialize #[]]
    def Lean.commitWhenSome? {m : TypeType} {s : Type} {ε : Type u_1} {α : Type} [inst : Monad m] [inst : Lean.MonadBacktrack s m] [inst : MonadExcept ε m] (x? : m (Option α)) :
    m (Option α)
    Equations
    • One or more equations did not get rendered due to their size.
    @[specialize #[]]
    def Lean.commitWhen {m : TypeType} {s : Type} {ε : Type u_1} [inst : Monad m] [inst : Lean.MonadBacktrack s m] [inst : MonadExcept ε m] (x : m Bool) :
    Equations
    • One or more equations did not get rendered due to their size.
    @[specialize #[]]
    def Lean.commitIfNoEx {m : TypeType} {s : Type} {ε : Type u_1} {α : Type} [inst : Monad m] [inst : Lean.MonadBacktrack s m] [inst : MonadExcept ε m] (x : m α) :
    m α
    Equations
    @[specialize #[]]
    def Lean.withoutModifyingState {m : TypeType} {s : Type} {α : Type} [inst : Monad m] [inst : MonadFinally m] [inst : Lean.MonadBacktrack s m] (x : m α) :
    m α
    Equations
    @[specialize #[]]
    def Lean.observing? {m : TypeType} {s : Type} {ε : Type u_1} {α : Type} [inst : Monad m] [inst : Lean.MonadBacktrack s m] [inst : MonadExcept ε m] (x : m α) :
    m (Option α)
    Equations
    • One or more equations did not get rendered due to their size.
    instance Lean.instMonadBacktrackExceptT {s : Type} {m : TypeType} {ε : Type} [inst : Lean.MonadBacktrack s m] [inst : Monad m] :
    Equations