From 1b1f952e8169e99532f663305100b2b37d55f46c Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 12 Mar 2016 11:56:25 +0100 Subject: restricted existentially qualified type --- restricted_exisential_type.icl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 restricted_exisential_type.icl diff --git a/restricted_exisential_type.icl b/restricted_exisential_type.icl new file mode 100644 index 0000000..0e0bff8 --- /dev/null +++ b/restricted_exisential_type.icl @@ -0,0 +1,14 @@ +module restricted_existential_type + +import StdString + +:: List = Nil + | E.e: Cons e List & toString e + +instance toString List +where + toString Nil = "[]" + toString (Cons e l) = "["+++toString e+++":"+++toString l+++"]" + +Start = toString (Cons 'a' (Cons 5 Nil)) + -- cgit v1.2.3