diff --git a/haskell/euler001.hs b/haskell/euler001.hs index f61b1a3..47c6705 100644 --- a/haskell/euler001.hs +++ b/haskell/euler001.hs @@ -1,6 +1,4 @@ module Main where -divisible_by_3_or_5 x = (mod x 3 == 0) || (mod x 5 == 0) - main = do - print (sum (filter divisible_by_3_or_5 [1..999])) + print $ sum [x | x <- [1..999], mod x 3 == 0 || mod x 5 == 0]