blog-static/code/compiler/13/examples/works5.txt

18 lines
344 B
Plaintext
Raw Permalink Normal View History

2020-09-08 18:38:05 -07:00
data List = { Nil, Cons Int List }
defn sumZip l m = {
case l of {
Nil -> { 0 }
Cons x xs -> {
case m of {
Nil -> { 0 }
Cons y ys -> { x + y + sumZip xs ys }
}
}
}
}
defn ones = { Cons 1 ones }
defn main = { sumZip ones (Cons 1 (Cons 2 (Cons 3 Nil))) }