From ad5b169146f4f95e8d3bf750a43e1043e150d153 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Wed, 13 Apr 2016 08:38:07 +0200 Subject: Overloaded constructors --- overloaded_constructors.icl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 overloaded_constructors.icl 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 + -- cgit v1.2.3