lean4-htt/tests/lean/625.lean
Sebastian Ullrich f47dfe9e7f
perf: Options.hasTrace (#12001)
Drastically speeds up `isTracingEnabledFor` in the common case, which
has evolved from "no options set" to "`Elab.async` and probably some
linter options set but no `trace`".

## Breaking changes

`Lean.Options` is now an opaque type. The basic but not all of the
`KVMap` API has been redefined on top of it.
2026-01-16 09:03:40 +00:00

18 lines
559 B
Text

import Lean
open Lean Lean.PrettyPrinter
def foo : PUnit → PUnit := id
def x : PUnit := ()
@[app_unexpander foo] def unexpandFoo : Unexpander := fun _ => `(sorry)
#eval do
let e : Expr := mkApp (mkMData {} $ mkConst `foo [levelOne]) (mkConst `x)
formatTerm (← delab e)
#eval do
let opts := ({}: MData).set `pp.universes true
-- the MData annotation should make it not a regular application,
-- so the unexpander should not be called.
let e : Expr := mkApp (mkMData opts $ mkConst `foo [levelOne]) (mkConst `x)
formatTerm (← delab e)