diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-07-29 16:38:15 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-07-29 16:38:15 -0400 |
commit | aa1b3a24913edd0dc97af0d1fc9e3dc0026a2460 (patch) | |
tree | ea20c705efe957d91b540e491ed8b7c6ff58efd9 /tests | |
parent | c9e2d6c9f290298c0068a72831d314793897f327 (diff) |
Parsing basic patterns
Diffstat (limited to 'tests')
-rw-r--r-- | tests/case.lac | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/case.lac b/tests/case.lac new file mode 100644 index 00000000..dc3fe03b --- /dev/null +++ b/tests/case.lac @@ -0,0 +1,12 @@ +datatype t = A | B + +val swap = fn x : t => case x of A => B | B => A + +datatype u = C of t | D + +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 => + case x of S (S O) => A | _ => B |