3 ms·
Finally I found out the correct version: foldr (+) 0 [1,2,3] 1. + contains only special characters and must be used either as infix function (1 + 2) or be encl
by Viktoras25 12y ago
Finally I found out the correct version:
foldr (+) 0 [1,2,3]
1. + contains only special characters and must be used either as infix function (1 + 2) or be enclosed in brackets
2. You need an initial value for the accumulator. You are reducing a list to a single value, you need to start somewhere
Please, gurus of Haskell, correct me if I'm wrong, I've just recently started to learn the language