diff options
author | Camil Staps | 2016-04-13 08:38:07 +0200 |
---|---|---|
committer | Camil Staps | 2016-04-13 08:38:07 +0200 |
commit | ad5b169146f4f95e8d3bf750a43e1043e150d153 (patch) | |
tree | 9e459eee3e933cfde6407ddd5c0d1003ab213666 | |
parent | gitignore (diff) |
Overloaded constructors
-rw-r--r-- | overloaded_constructors.icl | 11 |
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 + |