summaryrefslogtreecommitdiff
path: root/tests/type_class.lac
diff options
context:
space:
mode:
Diffstat (limited to 'tests/type_class.lac')
-rw-r--r--tests/type_class.lac9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/type_class.lac b/tests/type_class.lac
new file mode 100644
index 00000000..72baa3b3
--- /dev/null
+++ b/tests/type_class.lac
@@ -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] _