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

7 lines
199 B
Haskell

-- Version 6
-- foldl' isn't accessible by default
-- we need to import it from the module Data.List
import Data.List
evenSum l = foldl' mysum 0 (filter even l)
where mysum acc value = acc + value