Mercurial > urweb
annotate tests/case.ur @ 1907:cb57ba73a61d
make uninstall: Uninstall types_cpp.h, urweb_cpp.h
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | 71bafe66dbe1 |
children |
rev | line source |
---|---|
adamc@170 | 1 datatype t = A | B |
adamc@170 | 2 |
adamc@170 | 3 val swap = fn x : t => case x of A => B | B => A |
adamc@170 | 4 |
adamc@170 | 5 datatype u = C of t | D |
adamc@170 | 6 |
adamc@170 | 7 val out = fn x : u => case x of C y => y | D => A |
adamc@170 | 8 |
adamc@170 | 9 datatype nat = O | S of nat |
adamc@170 | 10 |
adamc@171 | 11 val is_two = fn x : nat => |
adamc@170 | 12 case x of S (S O) => A | _ => B |
adamc@171 | 13 |
adamc@171 | 14 val zero_is_two = is_two O |
adamc@171 | 15 val one_is_two = is_two (S O) |
adamc@171 | 16 val two_is_two = is_two (S (S O)) |