Equations
- Lean.Elab.Term.elabLiftMethod stx x = Lean.throwErrorAt stx (Lean.toMessageData "invalid use of `(<- ...)`, must be nested inside a 'do' expression")
- ref : Lean.Syntax
- vars : Array Lean.Elab.Term.Do.Var
- patterns : Lean.Syntax
- rhs : σ
instance
Lean.Elab.Term.Do.instInhabitedAlt:
{a : Type} → [inst : Inhabited a] → Inhabited (Lean.Elab.Term.Do.Alt a)
Equations
- Lean.Elab.Term.Do.instInhabitedAlt = { default := { ref := default, vars := default, patterns := default, rhs := default } }
- decl: Array Lean.Elab.Term.Do.Var → Lean.Syntax → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code
- reassign: Array Lean.Elab.Term.Do.Var → Lean.Syntax → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code
- joinpoint: Lean.Name → Array (Lean.Elab.Term.Do.Var × Bool) → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code
- seq: Lean.Syntax → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code
- action: Lean.Syntax → Lean.Elab.Term.Do.Code
- break: Lean.Syntax → Lean.Elab.Term.Do.Code
- continue: Lean.Syntax → Lean.Elab.Term.Do.Code
- return: Lean.Syntax → Lean.Syntax → Lean.Elab.Term.Do.Code
- ite: Lean.Syntax → Option Lean.Elab.Term.Do.Var → Lean.Syntax → Lean.Syntax → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code → Lean.Elab.Term.Do.Code
- match: Lean.Syntax → Lean.Syntax → Lean.Syntax → Lean.Syntax → Array (Lean.Elab.Term.Do.Alt Lean.Elab.Term.Do.Code) → Lean.Elab.Term.Do.Code
- jmp: Lean.Syntax → Lean.Name → Array Lean.Syntax → Lean.Elab.Term.Do.Code
Equations
- Lean.Elab.Term.Do.instInhabitedCode = { default := Lean.Elab.Term.Do.Code.action default }
@[inline]
- code : Lean.Elab.Term.Do.Code
- uvars : Lean.Elab.Term.Do.VarSet
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.hasExitPointPred
(c : Lean.Elab.Term.Do.Code)
(p : Lean.Elab.Term.Do.Code → Bool)
:
Equations
Equations
- Lean.Elab.Term.Do.hasExitPoint c = Lean.Elab.Term.Do.hasExitPointPred c fun x => true
Equations
- Lean.Elab.Term.Do.hasReturn c = Lean.Elab.Term.Do.hasExitPointPred c fun x => match x with | Lean.Elab.Term.Do.Code.return ref val => true | x => false
Equations
- Lean.Elab.Term.Do.hasTerminalAction c = Lean.Elab.Term.Do.hasExitPointPred c fun x => match x with | Lean.Elab.Term.Do.Code.action action => true | x => false
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.mkAuxDeclFor
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadQuotation m]
(e : Lean.Syntax)
(mkCont : Lean.Syntax → m Lean.Elab.Term.Do.Code)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.convertTerminalActionIntoJmp
(code : Lean.Elab.Term.Do.Code)
(jp : Lean.Name)
(xs : Array Lean.Elab.Term.Do.Var)
:
Equations
- name : Lean.Name
- params : Array (Lean.Elab.Term.Do.Var × Bool)
- body : Lean.Elab.Term.Do.Code
Equations
- Lean.Elab.Term.Do.attachJP jpDecl k = Lean.Elab.Term.Do.Code.joinpoint jpDecl.name jpDecl.params jpDecl.body k
def
Lean.Elab.Term.Do.attachJPs
(jpDecls : Array Lean.Elab.Term.Do.JPDecl)
(k : Lean.Elab.Term.Do.Code)
:
Equations
- Lean.Elab.Term.Do.attachJPs jpDecls k = Array.foldr Lean.Elab.Term.Do.attachJP k jpDecls (Array.size jpDecls)
def
Lean.Elab.Term.Do.mkFreshJP
(ps : Array (Lean.Elab.Term.Do.Var × Bool))
(body : Lean.Elab.Term.Do.Code)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.addFreshJP
(ps : Array (Lean.Elab.Term.Do.Var × Bool))
(body : Lean.Elab.Term.Do.Code)
:
Equations
- Lean.Elab.Term.Do.addFreshJP ps body = do let jp ← liftM (Lean.Elab.Term.Do.mkFreshJP ps body) modify fun jps => Array.push jps jp pure jp.name
def
Lean.Elab.Term.Do.insertVars
(rs : Lean.Elab.Term.Do.VarSet)
(xs : Array Lean.Elab.Term.Do.Var)
:
Equations
- Lean.Elab.Term.Do.insertVars rs xs = Array.foldl (fun rs x => Std.RBMap.insert rs (Lean.Syntax.getId x) x) rs xs 0 (Array.size xs)
def
Lean.Elab.Term.Do.eraseVars
(rs : Lean.Elab.Term.Do.VarSet)
(xs : Array Lean.Elab.Term.Do.Var)
:
Equations
- Lean.Elab.Term.Do.eraseVars rs xs = Array.foldl (fun a a_1 => Std.RBMap.erase a (Lean.Syntax.getId a_1)) rs xs 0 (Array.size xs)
def
Lean.Elab.Term.Do.eraseOptVar
(rs : Lean.Elab.Term.Do.VarSet)
(x? : Option Lean.Elab.Term.Do.Var)
:
Equations
- Lean.Elab.Term.Do.eraseOptVar rs x? = match x? with | none => rs | some x => Std.RBMap.insert rs (Lean.Syntax.getId x) x
def
Lean.Elab.Term.Do.mkSimpleJmp
(ref : Lean.Syntax)
(rs : Lean.Elab.Term.Do.VarSet)
(c : Lean.Elab.Term.Do.Code)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.mkJmp
(ref : Lean.Syntax)
(rs : Lean.Elab.Term.Do.VarSet)
(val : Lean.Syntax)
(mkJPBody : Lean.Syntax → Lean.MacroM Lean.Elab.Term.Do.Code)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.extendUpdatedVars
(c : Lean.Elab.Term.Do.CodeBlock)
(ws : Lean.Elab.Term.Do.VarSet)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.homogenize
(c₁ : Lean.Elab.Term.Do.CodeBlock)
(c₂ : Lean.Elab.Term.Do.CodeBlock)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.mkVarDeclCore
(xs : Array Lean.Elab.Term.Do.Var)
(stx : Lean.Syntax)
(c : Lean.Elab.Term.Do.CodeBlock)
:
Equations
- Lean.Elab.Term.Do.mkVarDeclCore xs stx c = { code := Lean.Elab.Term.Do.Code.decl xs stx c.code, uvars := Lean.Elab.Term.Do.eraseVars c.uvars xs }
def
Lean.Elab.Term.Do.mkReassignCore
(xs : Array Lean.Elab.Term.Do.Var)
(stx : Lean.Syntax)
(c : Lean.Elab.Term.Do.CodeBlock)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.mkSeq action c = { code := Lean.Elab.Term.Do.Code.seq action c.code, uvars := c.uvars }
Equations
- Lean.Elab.Term.Do.mkTerminalAction action = { code := Lean.Elab.Term.Do.Code.action action, uvars := ∅ }
Equations
- Lean.Elab.Term.Do.mkReturn ref val = { code := Lean.Elab.Term.Do.Code.return ref val, uvars := ∅ }
Equations
- Lean.Elab.Term.Do.mkBreak ref = { code := Lean.Elab.Term.Do.Code.break ref, uvars := ∅ }
Equations
- Lean.Elab.Term.Do.mkContinue ref = { code := Lean.Elab.Term.Do.Code.continue ref, uvars := ∅ }
def
Lean.Elab.Term.Do.mkIte
(ref : Lean.Syntax)
(optIdent : Lean.Syntax)
(cond : Lean.Syntax)
(thenBranch : Lean.Elab.Term.Do.CodeBlock)
(elseBranch : Lean.Elab.Term.Do.CodeBlock)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.mkMatch
(ref : Lean.Syntax)
(genParam : Lean.Syntax)
(discrs : Lean.Syntax)
(optMotive : Lean.Syntax)
(alts : Array (Lean.Elab.Term.Do.Alt Lean.Elab.Term.Do.CodeBlock))
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.concat
(terminal : Lean.Elab.Term.Do.CodeBlock)
(kRef : Lean.Syntax)
(y? : Option Lean.Elab.Term.Do.Var)
(k : Lean.Elab.Term.Do.CodeBlock)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.getLetIdDeclVar letIdDecl = Lean.Syntax.getOp letIdDecl 0
Equations
- Lean.Elab.Term.Do.getPatternVarsEx pattern = HOrElse.hOrElse (Lean.Elab.Term.getPatternVars pattern) fun x => Lean.Elab.Term.Quotation.getPatternVars pattern
Equations
- Lean.Elab.Term.Do.getPatternsVarsEx patterns = HOrElse.hOrElse (Lean.Elab.Term.getPatternsVars patterns) fun x => Lean.Elab.Term.Quotation.getPatternsVars patterns
Equations
- Lean.Elab.Term.Do.getLetPatDeclVars letPatDecl = let pattern := Lean.Syntax.getOp letPatDecl 0; Lean.Elab.Term.Do.getPatternVarsEx pattern
Equations
- Lean.Elab.Term.Do.getLetEqnsDeclVar letEqnsDecl = Lean.Syntax.getOp letEqnsDecl 0
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.getDoIdDeclVar doIdDecl = Lean.Syntax.getOp doIdDecl 0
Equations
- Lean.Elab.Term.Do.getDoPatDeclVars doPatDecl = let pattern := Lean.Syntax.getOp doPatDecl 0; Lean.Elab.Term.Do.getPatternVarsEx pattern
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.mkDoSeq doElems = (Lean.mkNode `Lean.Parser.Term.doSeqIndent #[Lean.mkNullNode (Array.map (fun doElem => Lean.mkNullNode #[doElem, Lean.mkNullNode]) doElems)]).raw
Equations
- Lean.Elab.Term.Do.mkSingletonDoSeq doElem = Lean.Elab.Term.Do.mkDoSeq #[doElem]
- ref : Lean.Syntax
- optIdent : Lean.Syntax
- cond : Lean.Syntax
- thenBranch : Lean.Syntax
- elseBranch : Lean.Syntax
Equations
- Lean.Elab.Term.Do.isDoExpr? doElem = if (Lean.Syntax.getKind doElem == `Lean.Parser.Term.doExpr) = true then some (Lean.Syntax.getOp doElem 0) else none
- regular: Lean.Elab.Term.Do.ToTerm.Kind
- forIn: Lean.Elab.Term.Do.ToTerm.Kind
- forInWithReturn: Lean.Elab.Term.Do.ToTerm.Kind
- nestedBC: Lean.Elab.Term.Do.ToTerm.Kind
- nestedPR: Lean.Elab.Term.Do.ToTerm.Kind
- nestedSBC: Lean.Elab.Term.Do.ToTerm.Kind
- nestedPRBC: Lean.Elab.Term.Do.ToTerm.Kind
Equations
- Lean.Elab.Term.Do.ToTerm.Kind.isRegular _fun_discr = match _fun_discr with | Lean.Elab.Term.Do.ToTerm.Kind.regular => true | x => false
- m : Lean.Syntax
- uvars : Array Lean.Elab.Term.Do.Var
@[inline]
Equations
- Lean.Elab.Term.Do.ToTerm.mkUVarTuple = do let ctx ← read liftM (Lean.Elab.Term.Do.mkTuple ctx.uvars)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.ToTerm.mkIte
(optIdent : Lean.Syntax)
(cond : Lean.Syntax)
(thenBranch : Lean.Syntax)
(elseBranch : Lean.Syntax)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.ToTerm.mkJoinPoint
(j : Lean.Name)
(ps : Array (Lean.Syntax × Bool))
(body : Lean.Syntax)
(k : Lean.Syntax)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.ToTerm.mkJmp ref j args = (Lean.Syntax.mkApp { raw := (Lean.mkIdentFrom ref j).raw } (Lean.TSyntaxArray.mk args)).raw
def
Lean.Elab.Term.Do.ToTerm.run
(code : Lean.Elab.Term.Do.Code)
(m : Lean.Syntax)
(uvars : optParam (Array Lean.Elab.Term.Do.Var) #[])
(kind : optParam Lean.Elab.Term.Do.ToTerm.Kind Lean.Elab.Term.Do.ToTerm.Kind.regular)
:
Equations
- Lean.Elab.Term.Do.ToTerm.run code m uvars kind = Lean.Elab.Term.Do.ToTerm.toTerm code { m := m, uvars := uvars, kind := kind }
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.ToTerm.mkNestedTerm
(code : Lean.Elab.Term.Do.Code)
(m : Lean.Syntax)
(uvars : Array Lean.Elab.Term.Do.Var)
(a : Bool)
(r : Bool)
(bc : Bool)
:
Equations
- Lean.Elab.Term.Do.ToTerm.mkNestedTerm code m uvars a r bc = Lean.Elab.Term.Do.ToTerm.run code m uvars (Lean.Elab.Term.Do.ToTerm.mkNestedKind a r bc)
def
Lean.Elab.Term.Do.ToTerm.matchNestedTermResult
(term : Lean.Syntax)
(uvars : Array Lean.Elab.Term.Do.Var)
(a : Bool)
(r : Bool)
(bc : Bool)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
- ref : Lean.Syntax
- m : Lean.Syntax
- mutableVars : Lean.Elab.Term.Do.VarSet
- insideFor : Bool
@[inline]
def
Lean.Elab.Term.Do.ToCodeBlock.withNewMutableVars
{α : Type}
(newVars : Array Lean.Elab.Term.Do.Var)
(mutable : Bool)
(x : Lean.Elab.Term.Do.ToCodeBlock.M α)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.ToCodeBlock.withFor x = withReader (fun ctx => { ref := ctx.ref, m := ctx.m, mutableVars := ctx.mutableVars, insideFor := true }) x
- uvars : Array Lean.Elab.Term.Do.Var
- term : Lean.Syntax
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.Do.ToCodeBlock.ensureEOS doElems = if List.isEmpty doElems = true then pure PUnit.unit else Lean.throwError (Lean.toMessageData "must be last element in a 'do' sequence")
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.ToCodeBlock.doReturnToCode
(doReturn : Lean.Syntax)
(doElems : List Lean.Syntax)
:
Equations
- One or more equations did not get rendered due to their size.
- x : Lean.Syntax
- optType : Lean.Syntax
- codeBlock : Lean.Elab.Term.Do.CodeBlock
def
Lean.Elab.Term.Do.ToCodeBlock.getTryCatchUpdatedVars
(tryCode : Lean.Elab.Term.Do.CodeBlock)
(catches : Array Lean.Elab.Term.Do.ToCodeBlock.Catch)
(finallyCode? : Option Lean.Elab.Term.Do.CodeBlock)
:
Equations
- One or more equations did not get rendered due to their size.
def
Lean.Elab.Term.Do.ToCodeBlock.tryCatchPred
(tryCode : Lean.Elab.Term.Do.CodeBlock)
(catches : Array Lean.Elab.Term.Do.ToCodeBlock.Catch)
(finallyCode? : Option Lean.Elab.Term.Do.CodeBlock)
(p : Lean.Elab.Term.Do.Code → Bool)
:
Equations
- One or more equations did not get rendered due to their size.
partial def
Lean.Elab.Term.Do.ToCodeBlock.doLetArrowToCode
(doLetArrow : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doLetElseToCode
(doLetElse : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doReassignArrowToCode
(doReassignArrow : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doIfToCode
(doIf : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doUnlessToCode
(doUnless : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doForToCode
(doFor : Lean.Syntax)
(doElems : List Lean.Syntax)
:
partial def
Lean.Elab.Term.Do.ToCodeBlock.doMatchToCode
(doMatch : Lean.Syntax)
(doElems : List Lean.Syntax)
:
Generate CodeBlock
for doMatch; doElems
partial def
Lean.Elab.Term.Do.ToCodeBlock.doTryToCode
(doTry : Lean.Syntax)
(doElems : List Lean.Syntax)
:
Generate CodeBlock
for doTry; doElems
def doTry := leading_parser "try " >> doSeq >> many (doCatch <|> doCatchMatch) >> optional doFinally def doCatch := leading_parser "catch " >> binderIdent >> optional (":" >> termParser) >> darrow >> doSeq def doCatchMatch := leading_parser "catch " >> doMatchAlts def doFinally := leading_parser "finally " >> doSeq
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Elab.Term.expandTermFor = Lean.Elab.Term.toDoElem `Lean.Parser.Term.doFor
Equations
- Lean.Elab.Term.expandTermTry = Lean.Elab.Term.toDoElem `Lean.Parser.Term.doTry
Equations
- Lean.Elab.Term.expandTermUnless = Lean.Elab.Term.toDoElem `Lean.Parser.Term.doUnless
Equations
- Lean.Elab.Term.expandTermReturn = Lean.Elab.Term.toDoElem `Lean.Parser.Term.doReturn