From ae494cac4389a07a6feef73a084e2db7ccb84e22 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 31 Jul 2008 10:44:52 -0400 Subject: Patterns for int and string constants --- tests/pcase.lac | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/pcase.lac (limited to 'tests') 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" -- cgit v1.2.3