File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,15 +213,13 @@ partial def reorderForall (reorder : ArgReorder) (e : Expr) : MetaM Expr := do
213213
214214/-- Reorder the arguments of a function using the given `ArgReorder`. -/
215215partial def reorderLambda (reorder : ArgReorder) (e : Expr) : MetaM Expr := do
216- let (mvars, bis, e) ← lambdaMetaTelescope e reorder.range
217- let (mvars', bis', _) ← forallMetaBoundedTelescope (← inferType e) (reorder.range - mvars.size)
218- let mut mvars := mvars ++ mvars'
216+ let (mvars, bis, _) ← forallMetaBoundedTelescope (← inferType e) reorder.range
219217 unless mvars.size = reorder.range do
220218 throwError "the permutation (reorder := {reorder}) is out of bounds, \
221219 the function{indentExpr e}\n has only {mvars.size} arguments"
222- let bis := reorder.permute! ( bis ++ bis') |>.toList
220+ let bis := reorder.permute! bis |>.toList
223221 -- Note that `mkLambdaFVars` also works with mvars.
224- fixBinderInfos bis <$> mkLambdaFVars (← reorderMVars mvars reorder) (mkAppN e mvars' )
222+ fixBinderInfos bis <$> mkLambdaFVars (← reorderMVars mvars reorder) (e.beta mvars)
225223
226224end
227225
Original file line number Diff line number Diff line change @@ -55,16 +55,17 @@ def SemilatticeSup.casesOn' {α} {motive : SemilatticeSup α → Sort*} (t : Sem
5555 t.casesOn mk
5656
5757/--
58- info: SemilatticeInf.casesOn'.{u_1} {α : Type} {motive : SemilatticeInf α → Sort u_1}
59- (mk :
60- [inst : Min α] →
61- [inst_1 : PartialOrder α] →
62- (sup_le : ∀ (b a c : α), c ≤ a → c ≤ b → c ≤ a ⊓ b) →
63- motive { toPartialOrder := inst_1, toMin := inst, le_inf := ⋯ })
64- (t : SemilatticeInf α) : motive t
58+ info: @[ expose ] def SemilatticeInf.casesOn'.{u_1} : {α : Type} →
59+ {motive : SemilatticeInf α → Sort u_1} →
60+ ([inst : Min α] →
61+ [inst_1 : PartialOrder α] →
62+ (sup_le : ∀ (b a c : α), c ≤ a → c ≤ b → c ≤ a ⊓ b) →
63+ motive { toPartialOrder := inst_1, toMin := inst, le_inf := ⋯ }) →
64+ (t : SemilatticeInf α) → motive t :=
65+ fun {α} {motive} mk t => SemilatticeInf.casesOn t fun [PartialOrder α] [Min α] sup_le => mk ⋯
6566-/
6667#guard_msgs in
67- #check SemilatticeInf.casesOn'
68+ #print SemilatticeInf.casesOn'
6869
6970class Semilattice (α : Type ) extends SemilatticeInf α, SemilatticeSup α
7071attribute [to_dual existing] Semilattice.toSemilatticeSup
You can’t perform that action at this time.
0 commit comments