summaryrefslogtreecommitdiff
path: root/tests/datatypeP.lac
diff options
context:
space:
mode:
Diffstat (limited to 'tests/datatypeP.lac')
-rw-r--r--tests/datatypeP.lac10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/datatypeP.lac b/tests/datatypeP.lac
new file mode 100644
index 00000000..12389322
--- /dev/null
+++ b/tests/datatypeP.lac
@@ -0,0 +1,10 @@
+datatype option a = None | Some of a
+
+val none : option int = None
+val some_1 : option int = Some 1
+
+val f = fn t ::: Type => fn x : option t =>
+ case x of None => None | Some x => Some (Some x)
+
+val none_again = f none
+val some_1_again = f some_1