churf/sample-programs/basic-0
2023-03-27 16:07:11 +02:00

11 lines
255 B
Text

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