Sets the default value to `pp.fieldNotation.generalized` to `true`. Updates tests, and fixes some minor flaws in the implementation of the generalized field notation pretty printer. Now generalized field notation won't be used for any function that has a `motive` argument. This is intended to prevent recursors from pretty printing using it as (1) recursors are more like control flow structures than actual functions and (2) generalized field notation tends to cause elaboration problems for recursors. Note: be sure functions that have an `@[app_unexpander]` use `@[pp_nodot]` if applicable. For example, `List.toArray` needs `@[pp_nodot]` to ensure the unexpander prints it using `#[...]` notation.
35 lines
836 B
Text
35 lines
836 B
Text
@[simp] def iota : Nat → List Nat
|
||
| 0 => []
|
||
| m@(n+1) => m :: iota n
|
||
|
||
/-- info: iota.eq_1 : iota 0 = [] -/
|
||
#guard_msgs in
|
||
#check iota.eq_1
|
||
|
||
/-- info: iota.eq_2 (n : Nat) : iota n.succ = n.succ :: iota n -/
|
||
#guard_msgs in
|
||
#check iota.eq_2
|
||
|
||
@[simp] def f : List Nat → List Nat × List Nat
|
||
| xs@(x :: ys@(y :: [])) => (xs, ys)
|
||
| xs@(x :: ys@(y :: zs)) => f zs
|
||
| _ => ([], [])
|
||
|
||
/-- info: f.eq_1 (x_1 y : Nat) : f [x_1, y] = ([x_1, y], [y]) -/
|
||
#guard_msgs in
|
||
#check f.eq_1
|
||
|
||
/--
|
||
info: f.eq_2 (x_1 y : Nat) (zs : List Nat) (x_2 : zs = [] → False) : f (x_1 :: y :: zs) = f zs
|
||
-/
|
||
#guard_msgs in
|
||
#check f.eq_2
|
||
|
||
/--
|
||
info: f.eq_3 :
|
||
∀ (x : List Nat),
|
||
(∀ (x_1 y : Nat), x = [x_1, y] → False) →
|
||
(∀ (x_1 y : Nat) (zs : List Nat), x = x_1 :: y :: zs → False) → f x = ([], [])
|
||
-/
|
||
#guard_msgs in
|
||
#check f.eq_3
|