lean4-htt/tests/lean/run/7353.lean
Kyle Miller c066b5cf1c
feat: pretty printing structures, omit default values (#7589)
This PR changes the structure instance notation pretty printer so that
fields are omitted if their value is definitionally equal to the default
value for the field (up to reducible transparancy). Setting
`pp.structureInstances.defaults` to true forces such fields to be pretty
printed anyway.

Closes #1100
2025-03-20 15:32:13 +00:00

20 lines
502 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 ((fun x => @Function.const Type (@Eq Unit Unit.unit Unit.unit) Nat foo.proof_1) Unit.unit)
(@OfNat.ofNat Nat 0 (instOfNatNat 0)) }
-/
#guard_msgs in
#print foo