Skip to content

Commit

Permalink
chore: deprecate Expr.lambdaArity in favor of existing upstream ver…
Browse files Browse the repository at this point in the history
…sion (#992)

Co-authored-by: François G. Dorais <fgdorais@gmail.com>
  • Loading branch information
kim-em and fgdorais authored Oct 18, 2024
1 parent 9e3d0d8 commit 6f56968
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Batteries/Lean/Expr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def toSyntax (e : Expr) : TermElabM Syntax.Term := withFreshMacroScope do
mvar.mvarId!.assign e
pure stx

@[deprecated (since := "2024-10-16"), inherit_doc getNumHeadLambdas]
abbrev lambdaArity := @getNumHeadLambdas

/--
Returns the number of leading `∀` binders of an expression. Ignores metadata.
-/
Expand All @@ -32,13 +35,9 @@ def forallArity : Expr → Nat
| forallE _ _ body _ => 1 + forallArity body
| _ => 0

/--
Returns the number of leading `λ` binders of an expression. Ignores metadata.
-/
def lambdaArity : Expr → Nat
| mdata _ b => lambdaArity b
| lam _ _ b _ => 1 + lambdaArity b
| _ => 0
-- TODO: replace `forallArity` after https://github.com/leanprover/lean4/pull/5729
-- @[deprecated (since := "2024-10-16"), inherit_doc getNumHeadForalls]
-- abbrev forallArity := @getNumHeadForalls

/-- Like `getAppNumArgs` but ignores metadata. -/
def getAppNumArgs' (e : Expr) : Nat :=
Expand Down

0 comments on commit 6f56968

Please sign in to comment.