lean4-htt/tests/lean/625.lean
2021-08-11 18:53:32 +02:00

18 lines
648 B
Text

import Lean
open Lean Lean.PrettyPrinter
def pfoo : PUnit → PUnit := id
def px : PUnit := ()
@[appUnexpander foo] def unexpandFoo : Unexpander := fun _ => `(sorry)
#eval show MetaM Format from do
let e : Expr := mkApp (mkMData {} $ mkConst `foo [levelOne]) (mkConst `x)
formatTerm (← delab Name.anonymous [] e)
#eval show MetaM Format from do
let opts := ({}: Options).setBool `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 Name.anonymous [] e)