This commit is contained in:
Martin Fredin 2023-03-28 15:33:03 +02:00
parent 133cc31e77
commit 76b1c55065
2 changed files with 25 additions and 15 deletions

View file

@ -3,9 +3,14 @@ data forall a. List (a) where {
Cons : a -> List (a) -> List (a)
};
length : forall c. List (c) -> Int;
length : List (Int) -> Int;
length = \list. case list of {
Cons x xs => 1 + length xs;
-- Nil => 0;
-- Cons x (Cons y Nil) => 2;
};