Given
```lean
structure A where
x : Nat
structure B extends A where
y : Nat
```
rather than pretty printing `{ x := 1, y := 2 : B }` as `{ toA := { x :=
1 }, y := 2 }`, it now pretty prints as `{ x := 1, y := 2 }`.
The option `pp.structureInstances.flatten` controls whether to flatten
structure instances like this.
27 lines
369 B
Text
27 lines
369 B
Text
/-!
|
|
# Testing eta reduction for structure instances
|
|
|
|
Implemented in PR #2478 for issue #2451.
|
|
-/
|
|
|
|
set_option pp.structureInstances.flatten false
|
|
|
|
structure A where
|
|
x : Nat
|
|
|
|
structure B extends A
|
|
|
|
structure C extends B
|
|
|
|
structure D extends B
|
|
|
|
def a : A := ⟨ 0 ⟩
|
|
|
|
def b : B := { a with }
|
|
#print b
|
|
|
|
def c : C := { a with }
|
|
#print c
|
|
|
|
def d : D := { c with }
|
|
#print d
|