File: .lake/packages/lean4/src/lean/Lean/Meta/ExprLens.lean

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Meta.lensCoord
code: /-- Given a constructor index for Expr, runs `g` on the value of that subexpression and replaces it.
If the subexpression is under a binder it will instantiate and abstract the binder body correctly.
Mdata is ignored. An index of 3 is interpreted as the type of the expression. An index of 3 will throw since we can't replace types.

See also `Lean.Meta.transform`, `Lean.Meta.traverseChildren`. -/
private def lensCoord (g : Expr → M Expr) (n : Nat) (e : Expr) : M Expr 
goal: M Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Meta.lensAux
code: private def lensAux (g : Expr → M Expr) : List Nat → Expr → M Expr
  
goal: List Nat → Lean.Expr → M Lean.Expr

full_name: Lean.Meta.replaceSubexpr
code: /-- Run the given `replace` function to replace the expression at the subexpression position. If the subexpression is below a binder
the bound variables will be appropriately instantiated with free variables and reabstracted after the replacement.
If the subexpression is invalid or points to a type then this will throw. -/
def replaceSubexpr (replace : (subexpr : Expr) → M Expr) (p : Pos) (root : Expr) : M Expr 
goal: M Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Meta.viewCoordAux
code: /-- Runs `k` on the given coordinate, including handling binders properly.
The subexpression value passed to `k` is not instantiated with respect to the
array of free variables. -/
private def viewCoordAux (k : Array Expr → Expr → M α) (fvars: Array Expr) (n : Nat) (e : Expr) : M α 
goal: M α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Meta.viewAux
code: private def viewAux (k : Array Expr → Expr → M α) (fvars : Array Expr) : List Nat → Expr → M α
  
goal: List Nat → Lean.Expr → M α

full_name: Lean.Meta.viewSubexpr
code: /-- `view visit p e` runs `visit fvars s` where `s : Expr` is the subexpression of `e` at `p`.
and `fvars` are the free variables for the binders that `s` is under.
`s` is already instantiated with respect to these.
The role of the `visit` function is analogous to the `k` function in `Lean.Meta.forallTelescope`. -/
def viewSubexpr
  (visit : (fvars : Array Expr) → (subexpr : Expr) → M α)
  (p : Pos) (root : Expr) :  M α 
goal: M α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Meta.foldAncestorsAux
code: private def foldAncestorsAux
  (k : Array Expr → Expr → Nat → α → M α)
  (acc : α) (address : List Nat) (fvars : Array Expr) (current : Expr) : M α 
goal: M α

full_name: Lean.Meta.foldAncestors
code: /-- `foldAncestors k init p e` folds over the strict ancestor subexpressions of the given expression `e` above position `p`, starting at the root expression and working down.
The fold function `k` is given the newly instantiated free variables, the ancestor subexpression, and the coordinate
that will be explored next.-/
def foldAncestors
  (k : (fvars: Array Expr) → (subexpr : Expr) → (nextCoord : Nat) → α → M α)
  (init : α) (p : Pos) (e : Expr) : M α 
goal: M α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Core.viewCoordRaw
code: /-- Get the raw subexpression without performing any instantiation. -/
private def viewCoordRaw (e : Expr) (n : Nat) : M Expr 
goal: M Lean.Expr

full_name: Lean.Core.viewSubexpr
code: /-- Given a valid `SubExpr`, return the raw current expression without performing any instantiation.
If the given `SubExpr` has a type subexpression coordinate, then throw an error.

This is a cheaper version of `Lean.Meta.viewSubexpr` and can be used to quickly view the
subexpression at a position. Note that because the resulting expression may contain
loose bound variables it can't be used in any `MetaM` methods. -/
def viewSubexpr (p : Pos) (root : Expr) : M Expr 
goal: M Lean.Expr

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Meta.ExprLens.0.Lean.Core.viewBindersCoord
code: private def viewBindersCoord : Nat → Expr → Option (Name × Expr)
  
goal: Nat → Lean.Expr → Option (Lean.Name × Lean.Expr)

full_name: Lean.Core.viewBinders
code: /-- `viewBinders p e` returns a list of all of the binders (name, type) above the given position `p` in the root expression `e` -/
def viewBinders (p : Pos) (root : Expr) : M (Array (Name × Expr)) 
goal: M (Array (Lean.Name × Lean.Expr))

full_name: Lean.Core.numBinders
code: /-- Returns the number of binders above a given subexpr position. -/
def numBinders (p : Pos) (e : Expr) : M Nat 
goal: M Nat