Qq
-ified spellings of functions in Lean.Meta
#
This file provides variants of the function in the Lean.Meta
namespace,
which operate with Q(_)
instead of Expr
.
Equations
- Qq.mkFreshExprMVarQ ty kind userName = Lean.Meta.mkFreshExprMVar (some ty) kind userName
Instances For
Equations
- Qq.withLocalDeclDQ name β k = Lean.Meta.withLocalDeclD name β k
Instances For
Equations
- Qq.withLocalDeclQ name bi β k = Lean.Meta.withLocalDecl name bi β k
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Qq.elabTermEnsuringTypeQ stx expectedType catchExPostpone implicitLambda errorMsgHeader? = Lean.Elab.Term.elabTermEnsuringType stx (some expectedType) catchExPostpone implicitLambda errorMsgHeader?
Instances For
A Qq
-ified version of Lean.Meta.inferType
Instead of writing let α ← inferType e
, this allows writing let ⟨u, α, e⟩ ← inferTypeQ e
,
which results in a context of
e✝ : Expr
u : Level
α : Q(Type u)
e : Q($α)
Here, the new e
is defeq to the old one, but now has Qq
-ascribed type information.
This is frequently useful when using the ~q
matching from QQ/Match.lean
,
as it allows an Expr
to be turned into something that can be matched upon.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If e
is a ty
, then view it as a term of Q($ty)
.
Equations
- Qq.checkTypeQ e ty = do let __do_lift ← Lean.Meta.inferType e let __do_lift ← Lean.Meta.isDefEq __do_lift ty if __do_lift = true then pure (some e) else pure none
Instances For
The result of Qq.isDefEqQ
; MaybeDefEq a b
is an optional version of $a =Q $b
.
- defEq {u : Lean.Level} {α : let u := u; Q(Sort u)} {a b : Q(«$α»)} : «$a» =Q «$b» → Qq.MaybeDefEq a b
- notDefEq {u : Lean.Level} {α : let u := u; Q(Sort u)} {a b : Q(«$α»)} : Qq.MaybeDefEq a b
Instances For
Equations
- One or more equations did not get rendered due to their size.
A version of Lean.Meta.isDefEq
which returns a strongly-typed witness rather than a bool.
Equations
- Qq.isDefEqQ a b = do let __do_lift ← Lean.Meta.isDefEq a b if __do_lift = true then pure (Qq.MaybeDefEq.defEq ⋯) else pure Qq.MaybeDefEq.notDefEq
Instances For
Like Qq.isDefEqQ
, but throws an error if not defeq.
Equations
- One or more equations did not get rendered due to their size.