From 447b60afccc89ef18d8f92a260dd1fcdf735898e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 31 Aug 2008 08:32:18 -0400 Subject: Laconic -> Ur --- tests/caseMod.ur | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/caseMod.ur (limited to 'tests/caseMod.ur') diff --git a/tests/caseMod.ur b/tests/caseMod.ur new file mode 100644 index 00000000..0a870160 --- /dev/null +++ b/tests/caseMod.ur @@ -0,0 +1,38 @@ +structure M = struct + datatype t = A | B +end + +val f = fn x : M.t => case x of M.A => M.B | M.B => M.A + +datatype t = datatype M.t + +val g = fn x : t => case x of M.A => B | B => M.A + +structure N = struct + datatype u = C of t | D +end + +val h = fn x : N.u => case x of N.C x => x | N.D => M.A + +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 rec page = fn x => + {cdata (toString x)}
+
+ + Again! + + +val main : unit -> page = fn () => +
  • C A
  • +
  • C B
  • +
  • D
  • + -- cgit v1.2.3