lean4-htt/tests/lean/run/7353.lean
Kyle Miller 29303b37b8
feat: have raw nat lits pretty print with nat_lit when pp.explicit is set (#7805)
This PR modifies the pretty printing of raw natural number literals; now
both `pp.explicit` and `pp.natLit` enable the `nat_lit` prefix. An
effect of this is that the hover on such a literal in the Infoview has
the `nat_lit` prefix.

Amendment to RFC #3021: In the reference-level explanation, now it
should read

> When `pp.natLit` and `pp.explicit` are false, then the `nat_lit n`
expression delaborates as `n`, and otherwise it delaborates as `nat_lit
n`.
2025-04-03 20:38:09 +00:00

20 lines
503 B
Text

structure Foo where
obj : Unit → Type
map : obj ()
def foo : Foo where
obj _ := Function.const (() = ()) Nat (id rfl)
map := id (0 : Nat)
set_option pp.proofs true
set_option pp.explicit true
/--
info: def foo : Foo :=
{ obj := fun x => @Function.const Type (@Eq Unit Unit.unit Unit.unit) Nat foo._proof_1,
map :=
@id (@Function.const Type (@Eq Unit Unit.unit Unit.unit) Nat foo._proof_1)
(@OfNat.ofNat Nat (nat_lit 0) (instOfNatNat (nat_lit 0))) }
-/
#guard_msgs in
#print foo