blog-static/code/compiler/03/works3.txt

8 lines
137 B
Plaintext
Raw Permalink Normal View History

2019-08-26 00:13:34 -07:00
data List = { Nil, Cons Int List }
defn length l = {
case l of {
Nil -> { 0 }
Cons x xs -> { 1 + length xs }
}
}