From 3374806d0f868f9e1c6fd874880d53e2ca4bffee Mon Sep 17 00:00:00 2001 From: Siddharth Bhat Date: Tue, 12 Oct 2021 06:31:26 +0530 Subject: [PATCH] refactor: eliminate unused `ExtractMonadResult.hasBindInst` --- src/Lean/Elab/Do.lean | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Lean/Elab/Do.lean b/src/Lean/Elab/Do.lean index c829509a01..c56b0cb4d3 100644 --- a/src/Lean/Elab/Do.lean +++ b/src/Lean/Elab/Do.lean @@ -87,15 +87,13 @@ private partial def hasLiftMethod : Syntax → Bool structure ExtractMonadResult where m : Expr α : Expr - hasBindInst : Expr expectedType : Expr isPure : Bool -- `true` when it is a pure `do` block. That is, Lean implicitly inserted the `Id` Monad. private def mkIdBindFor (type : Expr) : TermElabM ExtractMonadResult := do let u ← getDecLevel type let id := Lean.mkConst ``Id [u] - let idBindVal := Lean.mkConst ``Id.hasBind [u] - pure { m := id, hasBindInst := idBindVal, α := type, expectedType := mkApp id type, isPure := true } + pure { m := id, α := type, expectedType := mkApp id type, isPure := true } private partial def extractBind (expectedType? : Option Expr) : TermElabM ExtractMonadResult := do match expectedType? with @@ -106,8 +104,8 @@ private partial def extractBind (expectedType? : Option Expr) : TermElabM Extrac | Expr.app m α _ => try let bindInstType ← mkAppM ``Bind #[m] - let bindInstVal ← Meta.synthInstance bindInstType - return some { m := m, hasBindInst := bindInstVal, α := α, expectedType := expectedType, isPure := false } + let _ ← Meta.synthInstance bindInstType + return some { m := m, α := α, expectedType := expectedType, isPure := false } catch _ => return none | _ =>