diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-31 10:06:27 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-31 10:06:27 -0400 |
commit | f4351288c5b57b130c0a75e5e84a445ca513527f (patch) | |
tree | c0e69cdf2d843fbf3c5d2853ce2effe487090970 /tests | |
parent | aa1b3a24913edd0dc97af0d1fc9e3dc0026a2460 (diff) |
Elaborating some basic pattern matching
Diffstat (limited to 'tests')
-rw-r--r-- | tests/case.lac | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/case.lac b/tests/case.lac index dc3fe03b..b131b27b 100644 --- a/tests/case.lac +++ b/tests/case.lac @@ -8,5 +8,9 @@ val out = fn x : u => case x of C y => y | D => A datatype nat = O | S of nat -val is_two = fn x : int_list => +val is_two = fn x : nat => case x of S (S O) => A | _ => B + +val zero_is_two = is_two O +val one_is_two = is_two (S O) +val two_is_two = is_two (S (S O)) |