summaryrefslogtreecommitdiff
path: root/tests/pcase.lac
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 10:44:52 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-31 10:44:52 -0400
commitae494cac4389a07a6feef73a084e2db7ccb84e22 (patch)
tree86d47cf4bf1b2b404757efc6acf9b71797b69c83 /tests/pcase.lac
parentaa799f3af3da1bb7925031dc4f4b65ccf4e3971d (diff)
Patterns for int and string constants
Diffstat (limited to 'tests/pcase.lac')
-rw-r--r--tests/pcase.lac9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/pcase.lac b/tests/pcase.lac
new file mode 100644
index 00000000..581d94c3
--- /dev/null
+++ b/tests/pcase.lac
@@ -0,0 +1,9 @@
+val flip = fn x : int => case x of 0 => 1 | _ => 0
+
+val zero = flip 1
+val one = flip 0
+
+val flipS = fn x : string => case x of "" => "Hello world!" | _ => ""
+
+val s1 = flipS ""
+val s2 = flipS "Boop"