Module docstring
{}
{}
Lean.unbracketedExplicitBinders
definition
: Lean.ParserDescr✝
Lean.bracketedExplicitBinders
definition
: Lean.ParserDescr✝
Lean.explicitBinders
definition
: Lean.ParserDescr✝
Lean.expandExplicitBindersAux
definition
(combinator : Syntax) (idents : Array Syntax) (type? : Option Syntax) (body : Syntax) : MacroM Syntax
def expandExplicitBindersAux (combinator : Syntax) (idents : Array Syntax) (type? : Option Syntax) (body : Syntax) : MacroM Syntax :=
let rec loop (i : Nat) (h : i ≤ idents.size) (acc : Syntax) := do
match i with
| 0 => pure acc
| i + 1 =>
let ident := idents[i][0]
let acc ← match ident.isIdent, type? with
| true, none => `($combinator fun $ident => $acc)
| true, some type => `($combinator fun $ident : $type => $acc)
| false, none => `($combinator fun _ => $acc)
| false, some type => `($combinator fun _ : $type => $acc)
loop i (Nat.le_of_succ_le h) acc
loop idents.size (by simp) body
Lean.expandBrackedBindersAux
definition
(combinator : Syntax) (binders : Array Syntax) (body : Syntax) : MacroM Syntax
def expandBrackedBindersAux (combinator : Syntax) (binders : Array Syntax) (body : Syntax) : MacroM Syntax :=
let rec loop (i : Nat) (h : i ≤ binders.size) (acc : Syntax) := do
match i with
| 0 => pure acc
| i+1 =>
let idents := binders[i][1].getArgs
let type := binders[i][3]
loop i (Nat.le_of_succ_le h) (← expandExplicitBindersAux combinator idents (some type) acc)
loop binders.size (by simp) body
Lean.expandExplicitBinders
definition
(combinatorDeclName : Name) (explicitBinders : Syntax) (body : Syntax) : MacroM Syntax
def expandExplicitBinders (combinatorDeclName : Name) (explicitBinders : Syntax) (body : Syntax) : MacroM Syntax := do
let combinator := mkCIdentFrom (← getRef) combinatorDeclName
let explicitBinders := explicitBinders[0]
if explicitBinders.getKind == ``Lean.unbracketedExplicitBinders then
let idents := explicitBinders[0].getArgs
let type? := if explicitBinders[1].isNone then none else some explicitBinders[1][1]
expandExplicitBindersAux combinator idents type? body
else if explicitBinders.getArgs.all (·.getKind == ``Lean.bracketedExplicitBinders) then
expandBrackedBindersAux combinator explicitBinders.getArgs body
else
Macro.throwError "unexpected explicit binder"
Lean.expandBrackedBinders
definition
(combinatorDeclName : Name) (bracketedExplicitBinders : Syntax) (body : Syntax) : MacroM Syntax
def expandBrackedBinders (combinatorDeclName : Name) (bracketedExplicitBinders : Syntax) (body : Syntax) : MacroM Syntax := do
let combinator := mkCIdentFrom (← getRef) combinatorDeclName
expandBrackedBindersAux combinator #[bracketedExplicitBinders] body
Lean.unifConstraint
definition
: Lean.ParserDescr✝
Lean.unifConstraintElem
definition
: Lean.ParserDescr✝
Lean.command__Unif_hint____Where_|_-⊢_
definition
: Lean.ParserDescr✝
term∃_,_
definition
: Lean.ParserDescr✝
termExists_,_
definition
: Lean.ParserDescr✝
termΣ_,_
definition
: Lean.ParserDescr✝
termΣ'_,_
definition
: Lean.ParserDescr✝
term_×__1
definition
: Lean.ParserDescr✝
term_×'__1
definition
: Lean.ParserDescr✝
Lean.calcFirstStep
definition
: Lean.ParserDescr✝
Lean.calcStep
definition
: Lean.ParserDescr✝
Lean.calcSteps
definition
: Lean.ParserDescr✝
Lean.calc
definition
: Lean.ParserDescr✝
Lean.calcTactic
definition
: Lean.ParserDescr✝
Lean.convCalc_
definition
: Lean.ParserDescr✝
unexpandUnit
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Unit.unit] def unexpandUnit : Lean.PrettyPrinter.Unexpander
| `($(_)) => `(())
unexpandListNil
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander List.nil] def unexpandListNil : Lean.PrettyPrinter.Unexpander
| `($(_)) => `([])
unexpandListCons
definition
: Lean.PrettyPrinter.Unexpander
unexpandListToArray
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander List.toArray] def unexpandListToArray : Lean.PrettyPrinter.Unexpander
| `($(_) [$xs,*]) => `(#[$xs,*])
| _ => throw ()
unexpandProdMk
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Prod.mk] def unexpandProdMk : Lean.PrettyPrinter.Unexpander
| `($(_) $x ($y, $ys,*)) => `(($x, $y, $ys,*))
| `($(_) $x $y) => `(($x, $y))
| _ => throw ()
unexpandIte
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander ite] def unexpandIte : Lean.PrettyPrinter.Unexpander
| `($(_) $c $t $e) => `(if $c then $t else $e)
| _ => throw ()
unexpandEqNDRec
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Eq.ndrec] def unexpandEqNDRec : Lean.PrettyPrinter.Unexpander
| `($(_) $m $h) => `($h ▸ $m)
| _ => throw ()
unexpandEqRec
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Eq.rec] def unexpandEqRec : Lean.PrettyPrinter.Unexpander
| `($(_) $m $h) => `($h ▸ $m)
| _ => throw ()
unexpandExists
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Exists] def unexpandExists : Lean.PrettyPrinter.Unexpander
| `($(_) fun $x:ident => ∃ $xs:binderIdent*, $b) => `(∃ $x:ident $xs:binderIdent*, $b)
| `($(_) fun $x:ident => $b) => `(∃ $x:ident, $b)
| `($(_) fun ($x:ident : $t) => $b) => `(∃ ($x:ident : $t), $b)
| _ => throw ()
unexpandSigma
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Sigma] def unexpandSigma : Lean.PrettyPrinter.Unexpander
| `($(_) fun ($x:ident : $t) => $b) => `(($x:ident : $t) × $b)
| _ => throw ()
unexpandPSigma
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander PSigma] def unexpandPSigma : Lean.PrettyPrinter.Unexpander
| `($(_) fun ($x:ident : $t) => $b) => `(($x:ident : $t) ×' $b)
| _ => throw ()
unexpandSubtype
definition
: Lean.PrettyPrinter.Unexpander
unexpandTSyntax
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander TSyntax] def unexpandTSyntax : Lean.PrettyPrinter.Unexpander
| `($f [$k]) => `($f $k)
| _ => throw ()
unexpandTSyntaxArray
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander TSyntaxArray] def unexpandTSyntaxArray : Lean.PrettyPrinter.Unexpander
| `($f [$k]) => `($f $k)
| _ => throw ()
unexpandTSepArray
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Syntax.TSepArray] def unexpandTSepArray : Lean.PrettyPrinter.Unexpander
| `($f [$k] $sep) => `($f $k $sep)
| _ => throw ()
unexpandGetElem
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander GetElem.getElem] def unexpandGetElem : Lean.PrettyPrinter.Unexpander
| `($_ $array $index $_) => `($array[$index])
| _ => throw ()
unexpandGetElem!
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander getElem!] def unexpandGetElem! : Lean.PrettyPrinter.Unexpander
| `($_ $array $index) => `($array[$index]!)
| _ => throw ()
unexpandGetElem?
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander getElem?] def unexpandGetElem? : Lean.PrettyPrinter.Unexpander
| `($_ $array $index) => `($array[$index]?)
| _ => throw ()
unexpandArrayEmpty
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.empty] def unexpandArrayEmpty : Lean.PrettyPrinter.Unexpander
| _ => `(#[])
unexpandMkArray0
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray0] def unexpandMkArray0 : Lean.PrettyPrinter.Unexpander
| _ => `(#[])
unexpandMkArray1
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray1] def unexpandMkArray1 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1) => `(#[$a1])
| _ => throw ()
unexpandMkArray2
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray2] def unexpandMkArray2 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2) => `(#[$a1, $a2])
| _ => throw ()
unexpandMkArray3
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray3] def unexpandMkArray3 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3) => `(#[$a1, $a2, $a3])
| _ => throw ()
unexpandMkArray4
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray4] def unexpandMkArray4 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4) => `(#[$a1, $a2, $a3, $a4])
| _ => throw ()
unexpandMkArray5
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray5] def unexpandMkArray5 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5) => `(#[$a1, $a2, $a3, $a4, $a5])
| _ => throw ()
unexpandMkArray6
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray6] def unexpandMkArray6 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5 $a6) => `(#[$a1, $a2, $a3, $a4, $a5, $a6])
| _ => throw ()
unexpandMkArray7
definition
: Lean.PrettyPrinter.Unexpander
@[app_unexpander Array.mkArray7] def unexpandMkArray7 : Lean.PrettyPrinter.Unexpander
| `($(_) $a1 $a2 $a3 $a4 $a5 $a6 $a7) => `(#[$a1, $a2, $a3, $a4, $a5, $a6, $a7])
| _ => throw ()
unexpandMkArray8
definition
: Lean.PrettyPrinter.Unexpander
tacticFunext___
definition
: Lean.ParserDescr✝
Lean.Parser.Command.classAbbrev
definition
: Lean.ParserDescr✝
Lean.cdotTk
definition
: Lean.ParserDescr✝
syntax cdotTk := patternIgnore("· " <|> ". ")
Lean.cdot
definition
: Lean.ParserDescr✝
Lean.solveTactic
definition
: Lean.ParserDescr✝
Lean.term_Matches_|
definition
: Lean.TrailingParserDescr✝
term{_}
definition
: Lean.ParserDescr✝
Lean.singletonUnexpander
definition
: Lean.PrettyPrinter.Unexpander
/-- Unexpander for the `{ x }` notation. -/
@[app_unexpander singleton]
def singletonUnexpander : Lean.PrettyPrinter.Unexpander
| `($_ $a) => `({ $a:term })
| _ => throw ()
Lean.insertUnexpander
definition
: Lean.PrettyPrinter.Unexpander
/-- Unexpander for the `{ x, y, ... }` notation. -/
@[app_unexpander insert]
def insertUnexpander : Lean.PrettyPrinter.Unexpander
| `($_ $a { $ts:term,* }) => `({$a:term, $ts,*})
| _ => throw ()