aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorHugo Herbelin2018-10-31 13:11:23 +0100
committerHugo Herbelin2018-11-20 17:11:39 +0100
commit688859bb05c575d684e79822bd828d6d97be67d8 (patch)
tree876b14b0cccca9b0174e522b75ecf2e04e325525 /test-suite
parent100744560bd04184eb7e6c3fa36e8533e468e700 (diff)
Notations: Trying using a notation with or w/o removal of coercions.
Preferring a notation which does require a delimiter, depending on whether the coercion is removed or not, was done for primitive tokens. We do it for all notations.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/output/Notations4.out4
-rw-r--r--test-suite/output/Notations4.v24
2 files changed, 28 insertions, 0 deletions
diff --git a/test-suite/output/Notations4.out b/test-suite/output/Notations4.out
index 46784d1897..d25ad5dca8 100644
--- a/test-suite/output/Notations4.out
+++ b/test-suite/output/Notations4.out
@@ -17,3 +17,7 @@ end
: Expr -> Expr
[(1 + 1)]
: Expr
+Let "x" e1 e2
+ : expr
+Let "x" e1 e2
+ : expr
diff --git a/test-suite/output/Notations4.v b/test-suite/output/Notations4.v
index 6bdbf1bed5..7800e91ee5 100644
--- a/test-suite/output/Notations4.v
+++ b/test-suite/output/Notations4.v
@@ -70,3 +70,27 @@ Notation "( x )" := x (in custom expr at level 0, x at level 2).
Check [1 + 1].
End C.
+
+(* An example of interaction between coercion and notations from
+ Robbert Krebbers. *)
+
+Require Import String.
+
+Module D.
+
+Inductive expr :=
+ | Var : string -> expr
+ | Lam : string -> expr -> expr
+ | App : expr -> expr -> expr.
+
+Notation Let x e1 e2 := (App (Lam x e2) e1).
+
+Parameter e1 e2 : expr.
+
+Check (Let "x" e1 e2).
+
+Coercion App : expr >-> Funclass.
+
+Check (Let "x" e1 e2).
+
+End D.