This PR makes `#guard_msgs` to treat `trace` messages separate from `info`, `warning` and `error`. It also introduce the ability to say `#guard_msgs (pass info`, like `(drop info)` so far, and also adds `(check info)` as the explicit form of `(info)`, for completeness. Fixes #8266
29 lines
846 B
Text
29 lines
846 B
Text
import Lean
|
||
|
||
/-- `erased α` is the same as `α`, except that the elements
|
||
of `erased α` are erased in the VM in the same way as types
|
||
and proofs. This can be used to track data without storing it
|
||
literally. -/
|
||
def Erased (α : Sort u) : Sort max 1 u :=
|
||
Σ's : α → Prop, ∃ a, (fun b => a = b) = s
|
||
|
||
namespace Erased
|
||
|
||
/-- Erase a value. -/
|
||
@[inline]
|
||
def mk {α} (a : α) : Erased α :=
|
||
⟨fun b => a = b, a, rfl⟩
|
||
|
||
open Lean.Compiler
|
||
set_option pp.explicit true
|
||
set_option pp.funBinderTypes true
|
||
set_option pp.letVarTypes true
|
||
set_option trace.Compiler.result true
|
||
/--
|
||
trace: [Compiler.result] size: 1
|
||
def Erased.mk (α : lcErased) (a : lcAny) : PSigma lcErased lcAny :=
|
||
let _x.1 : PSigma lcErased lcAny := PSigma.mk lcErased ◾ ◾ ◾;
|
||
return _x.1
|
||
-/
|
||
#guard_msgs in
|
||
run_meta Lean.Compiler.compile #[``Erased.mk]
|