Skip to content

Commit

Permalink
chore: cleanup (#6021)
Browse files Browse the repository at this point in the history
This PR removes
- a duplicate `MonadMCtx` instance in `MetavarContext.lean`
- `:= return ←` that I had left there accidentally in a previous PR.
- the unnecessary application of `mapMetaM` in `withTransparency`.
  • Loading branch information
JovanGerb authored Nov 9, 2024
1 parent f55a9a7 commit 811d8fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Lean/Meta/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ Executes `x` tracking zetaDelta reductions `Config.trackZetaDelta := true`
withConfig (fun cfg => { cfg with proofIrrelevance := false }) x

@[inline] def withTransparency (mode : TransparencyMode) : n α → n α :=
mapMetaM <| withConfig (fun config => { config with transparency := mode })
withConfig (fun config => { config with transparency := mode })

/-- `withDefault x` executes `x` using the default transparency setting. -/
@[inline] def withDefault (x : n α) : n α :=
Expand Down
8 changes: 2 additions & 6 deletions src/Lean/MetavarContext.lean
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,6 @@ def incDepth (mctx : MetavarContext) (allowLevelAssignments := false) : MetavarC
if allowLevelAssignments then mctx.levelAssignDepth else depth
{ mctx with depth, levelAssignDepth }

instance : MonadMCtx (StateRefT MetavarContext (ST ω)) where
getMCtx := get
modifyMCtx := modify

namespace MkBinding

inductive Exception where
Expand Down Expand Up @@ -1275,10 +1271,10 @@ def mkBinding (isLambda : Bool) (xs : Array Expr) (e : Expr) (usedOnly : Bool :=
MkBinding.mkBinding isLambda ctx.lctx xs e usedOnly usedLetOnly etaReduce { preserveOrder := false, binderInfoForMVars, mvarIdsToAbstract, mainModule := ctx.mainModule }

@[inline] def mkLambda (xs : Array Expr) (e : Expr) (usedOnly : Bool := false) (usedLetOnly : Bool := true) (etaReduce := false) (binderInfoForMVars := BinderInfo.implicit) : MkBindingM Expr :=
returnmkBinding (isLambda := true) xs e usedOnly usedLetOnly etaReduce binderInfoForMVars
mkBinding (isLambda := true) xs e usedOnly usedLetOnly etaReduce binderInfoForMVars

@[inline] def mkForall (xs : Array Expr) (e : Expr) (usedOnly : Bool := false) (usedLetOnly : Bool := true) (binderInfoForMVars := BinderInfo.implicit) : MkBindingM Expr :=
returnmkBinding (isLambda := false) xs e usedOnly usedLetOnly false binderInfoForMVars
mkBinding (isLambda := false) xs e usedOnly usedLetOnly false binderInfoForMVars

@[inline] def abstractRange (e : Expr) (n : Nat) (xs : Array Expr) : MkBindingM Expr := fun ctx =>
MkBinding.abstractRange xs n e { preserveOrder := false, mainModule := ctx.mainModule }
Expand Down

0 comments on commit 811d8fb

Please sign in to comment.