diff tests/caseMod.lac @ 177:5d030ee143e2

Case through corify
author Adam Chlipala <adamc@hcoop.net>
date Sat, 02 Aug 2008 11:15:32 -0400
parents 7ee424760d2f
children c0ea24dcb86f
line wrap: on
line diff
--- a/tests/caseMod.lac	Thu Jul 31 16:28:55 2008 -0400
+++ b/tests/caseMod.lac	Sat Aug 02 11:15:32 2008 -0400
@@ -9,11 +9,27 @@
 val g = fn x : t => case x of M.A => B | B => M.A
 
 structure N = struct
-        datatype t = C of t | D
+        datatype u = C of t | D
 end
 
-val h = fn x : N.t => case x of N.C x => x | N.D => M.A
+val h = fn x : N.u => case x of N.C x => x | N.D => M.A
 
-datatype u = datatype N.t
+datatype u = datatype N.u
 
 val i = fn x : u => case x of N.C x => x | D => M.A
+
+val toString = fn x =>
+        case x of
+            C A => "C A"
+          | C B => "C B"
+          | D => "D"
+
+val page = fn x => <html><body>
+        {cdata (toString x)}
+</body></html>
+
+val main : unit -> page = fn () => <html><body>
+        <li> <a link={page (C A)}>C A</a></li>
+        <li> <a link={page (C B)}>C B</a></li>
+        <li> <a link={page D}>D</a></li>
+</body></html>