Documentation

Lean.PrettyPrinter.Delaborator.SubExpr

Subexpr utilities for delaborator. #

This file defines utilities for MetaM computations to traverse subexpressions of an expression in sync with the Nat "position" values that refer to them.

Equations
def Lean.PrettyPrinter.Delaborator.SubExpr.descend {α : Type} {m : TypeType} [MonadWithReaderOf SubExpr m] (child : Expr) (childIdx : Nat) (x : m α) :
m α
Equations
Equations
  • One or more equations did not get rendered due to their size.
partial def Lean.PrettyPrinter.Delaborator.SubExpr.withAppFnArgs {α : Type} {m : TypeType} [Monad m] [MonadReaderOf SubExpr m] [MonadWithReaderOf SubExpr m] (xf : m α) (xa : αm α) :
m α

Uses xa to compute the fold across the arguments of an application, where xf provides the initial value and is evaluated in the context of the head of the application.

def Lean.PrettyPrinter.Delaborator.SubExpr.withBoundedAppFnArgs {α : Type} {m : TypeType} [Monad m] [MonadReaderOf SubExpr m] [MonadWithReaderOf SubExpr m] (maxArgs : Nat) (xf : m α) (xa : αm α) :
m α

Uses xa to compute the fold across up to maxArgs outermost arguments of an application, where xf provides the initial value and is evaluated in the context of the application minus the arguments being folded across.

Runs xf in the context of Lean.Expr.getBoundedAppFn maxArgs. This is equivalent to withBoundedAppFnArgs maxArgs xf pure.

Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
def Lean.PrettyPrinter.Delaborator.SubExpr.withBindingBody' {α : Type} {m : TypeType} [Monad m] [MonadReaderOf SubExpr m] [MonadWithReaderOf SubExpr m] [MonadControlT MetaM m] {β : Type} (n : Name) (v : Exprm β) (x : βm α) :
m α

Assumes the SubExpr is a lambda or forall.

  1. Creates a local declaration for this binder using the name n.
  2. Evaluates v using the fvar for the local declaration.
  3. Enters the binding body, and evaluates x using this result.
Equations
  • One or more equations did not get rendered due to their size.

Assumes the SubExpr is a lambda or forall. Creates a local declaration for this binder using the name n, enters the binding body, and evaluates x.

Equations
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
Equations

The positioning scheme guarantees that there will be an infinite number of extra positions which are never used by Exprs. The HoleIterator always points at the next such "hole". We use these to attach additional Elab.Info.

Note: these positions are incompatible with Lean.SubExpr.Pos.push since the iterator will eventually yield every child of every returned position.

Equations
  • One or more equations did not get rendered due to their size.