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/datatypeP.ur | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/datatypeP.ur (limited to 'tests/datatypeP.ur') diff --git a/tests/datatypeP.ur b/tests/datatypeP.ur new file mode 100644 index 00000000..171d8812 --- /dev/null +++ b/tests/datatypeP.ur @@ -0,0 +1,21 @@ +datatype option a = None | Some of a + +val none : option int = None +val some_1 : option int = Some 1 + +val f = fn t ::: Type => fn x : option t => + case x of None => None | Some x => Some (Some x) + +val none_again = f none +val some_1_again = f some_1 + +val show = fn t ::: Type => fn x : option t => case x of None => "None" | Some _ => "Some" + +val page = fn x => + {cdata (show x)} + + +val main : unit -> page = fn () => +
  • None
  • +
  • Some 1
  • + -- cgit v1.2.3