summaryrefslogtreecommitdiff
path: root/tests/pvar.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-08-19 17:28:52 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-08-19 17:28:52 -0400
commit458bed0042d7bb206138ba6dce98686b056ae5c0 (patch)
tree025b60966e74a3a00397814e167b4c71e1a63783 /tests/pvar.ur
parent9da36d3a4dd89b2486b832384321c7a548ac67ca (diff)
Polymorphic variants
Diffstat (limited to 'tests/pvar.ur')
-rw-r--r--tests/pvar.ur5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/pvar.ur b/tests/pvar.ur
new file mode 100644
index 00000000..6b90e2c0
--- /dev/null
+++ b/tests/pvar.ur
@@ -0,0 +1,5 @@
+val v1 : variant [A = int, B = float] = make [#A] 1
+val v2 : variant [A = int, B = float] = make [#B] 2.3
+
+fun main () = return (match v1 {A = fn n => <xml>A: {[n]}</xml>,
+ B = fn n => <xml>B: {[n]}</xml>})