Skip to content

Commit 5e1991c

Browse files
committed
style: remove redundant <| and |>. (#31769)
This PR replaces all occurrences of `<| do` by `do`, and all occurrences of `(· |>.` with `(·.`.
1 parent 002a76d commit 5e1991c

File tree

18 files changed

+43
-43
lines changed

18 files changed

+43
-43
lines changed

Mathlib/Algebra/BigOperators/Expect.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ open Batteries.ExtendedBinder
8686
/-- Delaborator for `Finset.expect`. The `pp.funBinderTypes` option controls whether
8787
to show the domain type when the expect is over `Finset.univ`. -/
8888
@[scoped app_delab Finset.expect] def delabFinsetExpect : Delab :=
89-
whenPPOption getPPNotation <| withOverApp 6 <| do
89+
whenPPOption getPPNotation <| withOverApp 6 do
9090
let #[_, _, _, _, s, f] := (← getExpr).getAppArgs | failure
9191
guard <| f.isLambda
9292
let ppDomain ← getPPOption getPPFunBinderTypes

Mathlib/Algebra/BigOperators/Group/Finset/Defs.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private def delabFinsetArg (i : Ident) : DelabM FinsetResult := do
258258
/-- Delaborator for `Finset.prod`. The `pp.funBinderTypes` option controls whether
259259
to show the domain type when the product is over `Finset.univ`. -/
260260
@[app_delab Finset.prod] def delabFinsetProd : Delab :=
261-
whenPPOption getPPNotation <| withOverApp 5 <| do
261+
whenPPOption getPPNotation <| withOverApp 5 do
262262
let #[_, _, _, _, f] := (← getExpr).getAppArgs | failure
263263
guard f.isLambda
264264
let ppDomain ← getPPOption getPPFunBinderTypes
@@ -289,7 +289,7 @@ to show the domain type when the product is over `Finset.univ`. -/
289289
/-- Delaborator for `Finset.sum`. The `pp.funBinderTypes` option controls whether
290290
to show the domain type when the sum is over `Finset.univ`. -/
291291
@[app_delab Finset.sum] def delabFinsetSum : Delab :=
292-
whenPPOption getPPNotation <| withOverApp 5 <| do
292+
whenPPOption getPPNotation <| withOverApp 5 do
293293
let #[_, _, _, _, f] := (← getExpr).getAppArgs | failure
294294
guard f.isLambda
295295
let ppDomain ← getPPOption getPPFunBinderTypes

Mathlib/CategoryTheory/Closed/Cartesian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ notation:20 A " ⟹ " B:19 => (exp A).obj B
9999
open Lean PrettyPrinter.Delaborator SubExpr in
100100
/-- Delaborator for `Functor.obj` -/
101101
@[app_delab Functor.obj]
102-
def delabFunctorObjExp : Delab := whenPPOption getPPNotation <| withOverApp 6 <| do
102+
def delabFunctorObjExp : Delab := whenPPOption getPPNotation <| withOverApp 6 do
103103
let e ← getExpr
104104
guard <| e.isAppOfArity' ``Functor.obj 6
105105
let A ← withNaryArg 4 do

Mathlib/Lean/ContextInfo.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def runTactic (ctx : ContextInfo) (i : TacticInfo) (goal : MVarId) (x : MVarId
7272
panic!"ContextInfo.runTactic: `goal` must be an element of `i.goalsBefore`"
7373
let mctx := i.mctxBefore
7474
let lctx := (mctx.decls.find! goal).2
75-
ctx.runMetaMWithMessages lctx <| do
75+
ctx.runMetaMWithMessages lctx do
7676
-- Make a fresh metavariable because the original goal is already assigned.
7777
let type ← goal.getType
7878
let goal ← Meta.mkFreshExprSyntheticOpaqueMVar type

Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def borelToRefl (e : Expr) (i : FVarId) : TacticM Unit := do
157157
/-- Given a type `$t`, if there is an assumption `[i : MeasurableSpace $t]`, then try to prove
158158
`[BorelSpace $t]` and replace `i` with `borel $t`. Otherwise, add instances
159159
`borel $t : MeasurableSpace $t` and `⟨rfl⟩ : BorelSpace $t`. -/
160-
def borelize (t : Term) : TacticM Unit := withMainContext <| do
160+
def borelize (t : Term) : TacticM Unit := withMainContext do
161161
let u ← mkFreshLevelMVar
162162
let e ← withoutRecover <| Tactic.elabTermEnsuringType t (mkSort (mkLevelSucc u))
163163
let i? ← findLocalDeclWithType? (← mkAppOptM ``MeasurableSpace #[e])

Mathlib/Tactic/ApplyFun.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def applyFunHyp (f : Term) (using? : Option Term) (h : FVarId) (g : MVarId) :
3131
| (``Eq, #[_, lhs, rhs]) => do
3232
let (eq', gs) ←
3333
withCollectingNewGoalsFrom (parentTag := ← g.getTag) (tagSuffix := `apply_fun) <|
34-
withoutRecover <| runTermElab <| do
34+
withoutRecover <| runTermElab do
3535
let f ← Term.elabTerm f none
3636
let lhs' ← Term.elabAppArgs f #[] #[.expr lhs] none false false
3737
let rhs' ← Term.elabAppArgs f #[] #[.expr rhs] none false false

Mathlib/Tactic/HigherOrder.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def higherOrderGetParam (thm : Name) (stx : Syntax) : AttrM Name := do
7373
updatePrefix sname.getId thm.getPrefix
7474
else
7575
thm.appendAfter "\'"
76-
MetaM.run' <| TermElabM.run' <| do
76+
MetaM.run' <| TermElabM.run' do
7777
let lvl := (← getConstInfo thm).levelParams
7878
let typ ← instantiateMVars (← inferType <| .const thm (lvl.map mkLevelParam))
7979
let hot ← mkHigherOrderType typ

Mathlib/Tactic/Linarith/Preprocessing.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ open Zify
100100
`isNatProp tp` is true iff `tp` is an inequality or equality between natural numbers
101101
or the negation thereof.
102102
-/
103-
partial def isNatProp (e : Expr) : MetaM Bool := succeeds <| do
103+
partial def isNatProp (e : Expr) : MetaM Bool := succeeds do
104104
let (_, _, .const ``Nat [], _, _) ← e.ineqOrNotIneq? | failure
105105

106106
/-- If `e` is of the form `((n : ℕ) : C)`, `isNatCoe e` returns `⟨n, C⟩`. -/
@@ -162,7 +162,7 @@ def natToInt : GlobalBranchingPreprocessor where
162162
pure h
163163
else
164164
pure h
165-
withNewMCtxDepth <| AtomM.run .reducible <| do
165+
withNewMCtxDepth <| AtomM.run .reducible do
166166
let nonnegs ← l.foldlM (init := ∅) fun (es : TreeSet (Nat × Nat) lexOrd.compare) h => do
167167
try
168168
let (_, _, a, b) ← (← inferType h).ineq?

Mathlib/Tactic/NormNum/Prime.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ theorem not_prime_mul_of_ble (a b n : ℕ) (h : a * b = n) (h₁ : a.ble 1 = fal
3434

3535
/-- Produce a proof that `n` is not prime from a factor `1 < d < n`. `en` should be the expression
3636
that is the natural number literal `n`. -/
37-
def deriveNotPrime (n d : ℕ) (en : Q(ℕ)) : Q(¬ Nat.Prime $en) := Id.run <| do
37+
def deriveNotPrime (n d : ℕ) (en : Q(ℕ)) : Q(¬ Nat.Prime $en) := Id.run do
3838
let d' : ℕ := n / d
3939
let prf : Q($d * $d' = $en) := (q(Eq.refl $en) : Expr)
4040
let r : Q(Nat.ble $d 1 = false) := (q(Eq.refl false) : Expr)

Mathlib/Tactic/Simps/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,12 @@ Optionally, this command accepts three optional arguments:
801801
def getRawProjections (stx : Syntax) (str : Name) (traceIfExists : Bool := false)
802802
(rules : Array ProjectionRule := #[]) (trc := false) :
803803
CoreM (List Name × Array ProjectionData) := do
804-
withOptions (· |>.updateBool `trace.simps.verbose (trc || ·)) <| do
804+
withOptions (·.updateBool `trace.simps.verbose (trc || ·)) do
805805
let env ← getEnv
806806
if let some data := (structureExt.getState env).find? str then
807807
-- We always print the projections when they already exists and are called by
808808
-- `initialize_simps_projections`.
809-
withOptions (· |>.updateBool `trace.simps.verbose (traceIfExists || ·)) <| do
809+
withOptions (·.updateBool `trace.simps.verbose (traceIfExists || ·)) do
810810
trace[simps.verbose]
811811
projectionsInfo data.2.toList "The projections for this structure have already been \
812812
initialized by a previous invocation of `initialize_simps_projections` or `@[simps]`.\n\
@@ -1193,7 +1193,7 @@ If `shortNm` is true, the generated names will only use the last projection name
11931193
If `trc` is true, trace as if `trace.simps.verbose` is true. -/
11941194
def simpsTac (ref : Syntax) (nm : Name) (cfg : Config := {})
11951195
(todo : List (String × Syntax) := []) (trc := false) : AttrM (Array Name) :=
1196-
withOptions (· |>.updateBool `trace.simps.verbose (trc || ·)) <| do
1196+
withOptions (·.updateBool `trace.simps.verbose (trc || ·)) do
11971197
let env ← getEnv
11981198
let some d := env.find? nm | throwError "Declaration {nm} doesn't exist."
11991199
let lhs : Expr := mkConst d.name <| d.levelParams.map Level.param

0 commit comments

Comments
 (0)