Skip to content

Commit aa72692

Browse files
committed
chore: use app_delab (#20249)
This has the same behavior as `delab app.`, but protects against typos. The feature appeared in leanprover/lean4#4976, though won't be documented until leanprover/lean4#6450.
1 parent 9bfe1e0 commit aa72692

File tree

14 files changed

+20
-20
lines changed

14 files changed

+20
-20
lines changed

Mathlib/Algebra/BigOperators/Expect.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ open Batteries.ExtendedBinder
8585

8686
/-- Delaborator for `Finset.expect`. The `pp.piBinderTypes` option controls whether
8787
to show the domain type when the expect is over `Finset.univ`. -/
88-
@[scoped delab app.Finset.expect] def delabFinsetExpect : Delab :=
88+
@[scoped app_delab Finset.expect] def delabFinsetExpect : Delab :=
8989
whenPPOption getPPNotation <| withOverApp 6 <| do
9090
let #[_, _, _, _, s, f] := (← getExpr).getAppArgs | failure
9191
guard <| f.isLambda

Mathlib/Algebra/BigOperators/Group/Finset.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ open scoped Batteries.ExtendedBinder
218218

219219
/-- Delaborator for `Finset.prod`. The `pp.piBinderTypes` option controls whether
220220
to show the domain type when the product is over `Finset.univ`. -/
221-
@[delab app.Finset.prod] def delabFinsetProd : Delab :=
221+
@[app_delab Finset.prod] def delabFinsetProd : Delab :=
222222
whenPPOption getPPNotation <| withOverApp 5 <| do
223223
let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
224224
guard <| f.isLambda
@@ -239,7 +239,7 @@ to show the domain type when the product is over `Finset.univ`. -/
239239

240240
/-- Delaborator for `Finset.sum`. The `pp.piBinderTypes` option controls whether
241241
to show the domain type when the sum is over `Finset.univ`. -/
242-
@[delab app.Finset.sum] def delabFinsetSum : Delab :=
242+
@[app_delab Finset.sum] def delabFinsetSum : Delab :=
243243
whenPPOption getPPNotation <| withOverApp 5 <| do
244244
let #[_, _, _, s, f] := (← getExpr).getAppArgs | failure
245245
guard <| f.isLambda

Mathlib/Analysis/InnerProductSpace/PiL2.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ macro_rules | `(!$p:subscript[$e:term,*]) => do
119119

120120
set_option trace.debug true in
121121
/-- Unexpander for the `!₂[x, y, ...]` notation. -/
122-
@[delab app.DFunLike.coe]
122+
@[app_delab DFunLike.coe]
123123
def EuclideanSpace.delabVecNotation : Delab :=
124124
whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 6 do
125125
-- check that the `(WithLp.equiv _ _).symm` is present

Mathlib/CategoryTheory/Closed/Cartesian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ notation:20 A " ⟹ " B:19 => (exp A).obj B
117117

118118
open Lean PrettyPrinter.Delaborator SubExpr in
119119
/-- Delaborator for `Prefunctor.obj` -/
120-
@[delab app.Prefunctor.obj]
120+
@[app_delab Prefunctor.obj]
121121
def delabPrefunctorObjExp : Delab := whenPPOption getPPNotation <| withOverApp 6 <| do
122122
let e ← getExpr
123123
guard <| e.isAppOfArity' ``Prefunctor.obj 6

Mathlib/CategoryTheory/Monoidal/Category.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ scoped notation "𝟙_ " C:max => (MonoidalCategoryStruct.tensorUnit : C)
124124

125125
open Lean PrettyPrinter.Delaborator SubExpr in
126126
/-- Used to ensure that `𝟙_` notation is used, as the ascription makes this not automatic. -/
127-
@[delab app.CategoryTheory.MonoidalCategoryStruct.tensorUnit]
127+
@[app_delab CategoryTheory.MonoidalCategoryStruct.tensorUnit]
128128
def delabTensorUnit : Delab := whenPPOption getPPNotation <| withOverApp 3 do
129129
let e ← getExpr
130130
guard <| e.isAppOfArity ``MonoidalCategoryStruct.tensorUnit 3

Mathlib/Data/Matrix/Notation.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ macro_rules
111111
| `(!![$[,%$commas]*]) => `(@Matrix.of (Fin 0) (Fin $(quote commas.size)) _ ![])
112112

113113
/-- Delaborator for the `!![]` notation. -/
114-
@[delab app.DFunLike.coe]
114+
@[app_delab DFunLike.coe]
115115
def delabMatrixNotation : Delab := whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <|
116116
withOverApp 6 do
117117
let mkApp3 (.const ``Matrix.of _) (.app (.const ``Fin _) em) (.app (.const ``Fin _) en) _ :=

Mathlib/Data/Prod/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ section delaborators
304304
open Lean PrettyPrinter Delaborator
305305

306306
/-- Delaborator for `Prod.fst x` as `x.1`. -/
307-
@[delab app.Prod.fst]
307+
@[app_delab Prod.fst]
308308
def delabProdFst : Delab := withOverApp 3 do
309309
let x ← SubExpr.withAppArg delab
310310
`($(x).1)
311311

312312
/-- Delaborator for `Prod.snd x` as `x.2`. -/
313-
@[delab app.Prod.snd]
313+
@[app_delab Prod.snd]
314314
def delabProdSnd : Delab := withOverApp 3 do
315315
let x ← SubExpr.withAppArg delab
316316
`($(x).2)

Mathlib/Data/SetLike/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ open Lean PrettyPrinter.Delaborator SubExpr
117117
/-- For terms that match the `CoeSort` instance's body, pretty print as `↥S`
118118
rather than as `{ x // x ∈ S }`. The discriminating feature is that membership
119119
uses the `SetLike.instMembership` instance. -/
120-
@[delab app.Subtype]
120+
@[app_delab Subtype]
121121
def delabSubtypeSetLike : Delab := whenPPOption getPPNotation do
122122
let #[_, .lam n _ body _] := (← getExpr).getAppArgs | failure
123123
guard <| body.isAppOf ``Membership.mem

Mathlib/FieldTheory/Adjoin.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ generated by these elements. -/
600600
scoped macro:max K:term "⟮" xs:term,* "⟯" : term => do ``(adjoin $K $(← mkInsertTerm xs.getElems))
601601

602602
open Lean PrettyPrinter.Delaborator SubExpr in
603-
@[delab app.IntermediateField.adjoin]
603+
@[app_delab IntermediateField.adjoin]
604604
partial def delabAdjoinNotation : Delab := whenPPOption getPPNotation do
605605
let e ← getExpr
606606
guard <| e.isAppOfArity ``adjoin 6

Mathlib/LinearAlgebra/LinearIndependent.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ in case the family of vectors is over a `Set`.
109109
110110
Type hints look like `LinearIndependent fun (v : ↑s) => ↑v` or `LinearIndependent (ι := ↑s) f`,
111111
depending on whether the family is a lambda expression or not. -/
112-
@[delab app.LinearIndependent]
112+
@[app_delab LinearIndependent]
113113
def delabLinearIndependent : Delab :=
114114
whenPPOption getPPNotation <|
115115
whenNotPPOption getPPAnalysisSkip <|

0 commit comments

Comments
 (0)