| 1 |
Set Printing Parentheses. |
| 2 |
|
| 3 |
Module Constr. |
| 4 |
Parameters x y z : nat. |
| 5 |
Notation "a `+ b" := (a + b) (at level 50, b at level 50, left associativity). |
| 6 |
Check (x `+ y `+ z). |
| 7 |
End Constr. |
| 8 |
|
| 9 |
Module CustomGlobal. |
| 10 |
Declare Custom Entry foo. |
| 11 |
Notation "a `+ b" := (a + b) (in custom foo at level 50, b at level 50). |
| 12 |
Notation "x" := x (in custom foo at level 0, x global). |
| 13 |
Notation "( x )" := x (in custom foo at level 0). |
| 14 |
Notation "[ a ]" := a (a custom foo). |
| 15 |
Parameters x y z : nat. |
| 16 |
Check [x `+ y `+ z]. |
| 17 |
Check fun x y z => [x `+ y `+ z]. |
| 18 |
End CustomGlobal. |
| 19 |
|
| 20 |
Module CustomIdent. |
| 21 |
Declare Custom Entry bar. |
| 22 |
Notation "a `+ b" := (a + b) (in custom bar at level 50, b at level 50). |
| 23 |
Notation "x" := x (in custom bar at level 0, x ident). |
| 24 |
Notation "( x )" := x (in custom bar at level 0). |
| 25 |
Notation "[ a ]" := a (a custom bar). |
| 26 |
Check fun x y z => [x `+ y `+ z]. |
| 27 |
End CustomIdent. |