From a18c30dca8a6bfbb2ab4dfd47a17fe99ea8bb1c5 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 14 Apr 2020 15:58:13 -0700 Subject: [PATCH] Update example to include polymorphism --- 11/examples/works3.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/11/examples/works3.txt b/11/examples/works3.txt index 2123089..cfd2ef3 100644 --- a/11/examples/works3.txt +++ b/11/examples/works3.txt @@ -1,4 +1,4 @@ -data List = { Nil, Cons Int List } +data List a = { Nil, Cons a (List a) } data Bool = { True, False } defn length l = { case l of { @@ -6,4 +6,4 @@ defn length l = { Cons x xs -> { 1 + length xs } } } -defn main = { length (Cons True (Cons False (Cons True Nil))) } +defn main = { length (Cons 1 (Cons 2 (Cons 3 Nil))) + length (Cons True (Cons False (Cons True Nil))) }