diff tests/type_class.lac @ 211:e86411f647c6

Initial type class support
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 14:32:18 -0400
parents
children ba4d7c33a45f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/type_class.lac	Sat Aug 16 14:32:18 2008 -0400
@@ -0,0 +1,9 @@
+class default t = t
+
+val string_default : default string = ""
+val int_default : default int = 0
+
+val default : t :: Type -> default t -> t =
+        fn t :: Type => fn d : default t => d
+val empty = default [string] _
+val zero = default [int] _