Instances
- Lean.instToExprDeclarationRanges
- Lean.Position.instToExprPosition
- Lean.instToExprUnit
- Lean.instToExprOption
- Lean.instToExprList
- Lean.instToExprNat
- Lean.instToExprArray
- Lean.instToExprProd
- Lean.instToExprDeclarationRange
- Lean.instToExprBool
- Lean.instToExprName
- Lean.instToExprString
- Lean.instToExprChar
Equations
- Lean.instToExprNat = { toExpr := Lean.mkNatLit, toTypeExpr := Lean.mkConst `Nat }
Equations
- Lean.instToExprBool = { toExpr := fun b => if b = true then Lean.mkConst `Bool.true else Lean.mkConst `Bool.false, toTypeExpr := Lean.mkConst `Bool }
Equations
- Lean.instToExprChar = { toExpr := fun c => Lean.mkApp (Lean.mkConst `Char.ofNat) (Lean.toExpr (Char.toNat c)), toTypeExpr := Lean.mkConst `Char }
Equations
- Lean.instToExprString = { toExpr := Lean.mkStrLit, toTypeExpr := Lean.mkConst `String }
Equations
- Lean.instToExprUnit = { toExpr := fun x => Lean.mkConst `Unit.unit, toTypeExpr := Lean.mkConst `Unit }
Equations
- Lean.Name.toExprAux Lean.Name.anonymous = Lean.mkConst `Lean.Name.anonymous
- Lean.Name.toExprAux (Lean.Name.str p s x_1) = Lean.mkAppB (Lean.mkConst `Lean.Name.mkStr) (Lean.Name.toExprAux p) (Lean.toExpr s)
- Lean.Name.toExprAux (Lean.Name.num p n x_1) = Lean.mkAppB (Lean.mkConst `Lean.Name.mkNum) (Lean.Name.toExprAux p) (Lean.toExpr n)
Equations
- Lean.instToExprName = { toExpr := Lean.Name.toExprAux, toTypeExpr := Lean.mkConst `Lean.Name }
Equations
- Lean.instToExprOption = let type := Lean.toTypeExpr α; { toExpr := fun o => match o with | none => Lean.mkApp (Lean.mkConst `Option.none [Lean.levelZero]) type | some a => Lean.mkApp2 (Lean.mkConst `Option.some [Lean.levelZero]) type (Lean.toExpr a), toTypeExpr := Lean.mkApp (Lean.mkConst `Option [Lean.levelZero]) type }
def
Lean.List.toExprAux
{α : Type u_1}
[inst : Lean.ToExpr α]
(nilFn : Lean.Expr)
(consFn : Lean.Expr)
:
Equations
- Lean.List.toExprAux nilFn consFn [] = nilFn
- Lean.List.toExprAux nilFn consFn (a :: as) = Lean.mkApp2 consFn (Lean.toExpr a) (Lean.List.toExprAux nilFn consFn as)
Equations
- Lean.instToExprList = let type := Lean.toTypeExpr α; let nil := Lean.mkApp (Lean.mkConst `List.nil [Lean.levelZero]) type; let cons := Lean.mkApp (Lean.mkConst `List.cons [Lean.levelZero]) type; { toExpr := Lean.List.toExprAux nil cons, toTypeExpr := Lean.mkApp (Lean.mkConst `List [Lean.levelZero]) type }
Equations
- Lean.instToExprArray = let type := Lean.toTypeExpr α; { toExpr := fun as => Lean.mkApp2 (Lean.mkConst `List.toArray [Lean.levelZero]) type (Lean.toExpr (Array.toList as)), toTypeExpr := Lean.mkApp (Lean.mkConst `Array [Lean.levelZero]) type }
instance
Lean.instToExprProd
{α : Type}
{β : Type}
[inst : Lean.ToExpr α]
[inst : Lean.ToExpr β]
:
Lean.ToExpr (α × β)
Equations
- Lean.instToExprProd = let αType := Lean.toTypeExpr α; let βType := Lean.toTypeExpr β; { toExpr := fun x => match x with | (a, b) => Lean.mkApp4 (Lean.mkConst `Prod.mk [Lean.levelZero, Lean.levelZero]) αType βType (Lean.toExpr a) (Lean.toExpr b), toTypeExpr := Lean.mkApp2 (Lean.mkConst `Prod [Lean.levelZero, Lean.levelZero]) αType βType }