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/type_class.ur | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/type_class.ur (limited to 'tests/type_class.ur') diff --git a/tests/type_class.ur b/tests/type_class.ur new file mode 100644 index 00000000..0acca7cd --- /dev/null +++ b/tests/type_class.ur @@ -0,0 +1,18 @@ +class default t = t + +val string_default : default string = "Hi" +val int_default : default int = 0 + +val default : t :: Type -> default t -> t = + fn t :: Type => fn d : default t => d +val hi = default [string] _ +val zero = default [int] _ + +val frob : t :: Type -> default t -> t = + fn t :: Type => fn _ : default t => default [t] _ +val hi_again = frob [string] _ +val zero_again = frob [int] _ + +val main : unit -> page = fn () => + {cdata hi_again} + -- cgit v1.2.3