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/caseFfi.ur | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/caseFfi.ur (limited to 'tests/caseFfi.ur') diff --git a/tests/caseFfi.ur b/tests/caseFfi.ur new file mode 100644 index 00000000..76232cb3 --- /dev/null +++ b/tests/caseFfi.ur @@ -0,0 +1,28 @@ +extern structure M : sig + datatype t = A | B + datatype u = C of t | D +end + +val f = fn x => case x of M.A => M.B | M.B => M.A + +val t2s = fn x => case x of M.A => "A" | M.B => "B" + +val g = fn x => case x of M.C a => M.C (f a) | M.D => M.C M.A + +val u2s = fn x => case x of M.C a => t2s a | M.D => "D" + +val page = fn x => + {cdata (t2s x)} + + +val page2 = fn x => + {cdata (u2s x)} + + +val main : unit -> page = fn () => +
  • A
  • +
  • B
  • +
  • C A
  • +
  • C B
  • +
  • D
  • + -- cgit v1.2.3