Mercurial > urweb
diff tests/type_class.ur @ 244:71bafe66dbe1
Laconic -> Ur
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 31 Aug 2008 08:32:18 -0400 |
parents | tests/type_class.lac@ba4d7c33a45f |
children | fab5998b840e |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/type_class.ur Sun Aug 31 08:32:18 2008 -0400 @@ -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 () => <html><body> + {cdata hi_again} +</body></html>