summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--overloaded_constructors.icl11
1 files changed, 11 insertions, 0 deletions
diff --git a/overloaded_constructors.icl b/overloaded_constructors.icl
new file mode 100644
index 0000000..5d3adc8
--- /dev/null
+++ b/overloaded_constructors.icl
@@ -0,0 +1,11 @@
+module overloaded_constructors
+
+:: Tree a = Node a (Tree a) (Tree a) | TreeNil
+:: List a = Cons a (List a) | ListNil
+
+class Nil a :: a b
+instance Nil Tree where Nil = TreeNil
+instance Nil List where Nil = ListNil
+
+Start = Cons 5 Nil
+