her.esy.fun/src/posts/0010-Haskell-Now/evenSum_v7.hs
Yann Esposito (Yogsototh) 7784f02483
wip
2019-12-25 16:35:56 +01:00

6 lines
180 B
Haskell

-- Version 7
-- Generally it is considered a good practice
-- to import only the necessary function(s)
import Data.List (foldl')
evenSum l = foldl' (\x y -> x+y) 0 (filter even l)