A Hugo incarnation of the blog.
https://danilafe.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
191 B
8 lines
191 B
data List = { Nil, Cons Int List }
|
|
defn length l = {
|
|
case l of {
|
|
Nil -> { 0 }
|
|
Cons x xs -> { 1 + length xs }
|
|
}
|
|
}
|
|
defn main = { length (Cons 1 (Cons 2 (Cons 3 Nil))) }
|
|
|