
18 Oct
2011
18 Oct
'11
12:51 p.m.
There seems to be something missing from this line:
add' (a:as) (b:bs) s ++ [a+b]
Assuming you want to write your own function as an exercise, you could write it as a recursive function like this: add [] b = b add a [] = a add (a:as) (b:bs) = (a+b) : (add as bs) FYI, the easiest way to accomplish what you want is: add = zipWith (+) which is equivalent to: add a b = zipWith (+) a b Hope that helps