cleaner haskell 001

master
Evan Hemsley 2020-10-26 23:19:49 -07:00
parent b2e1e06499
commit 5061e75030
1 changed files with 1 additions and 3 deletions

View File

@ -1,8 +1,6 @@
module Main where
up_to x = take (x-1) (iterate (1+) 1)
divisible_by_3_or_5 x = (x `mod` 3 == 0) || (x `mod` 5 == 0)
main = do
print (sum (filter divisible_by_3_or_5 (up_to 1000)))
print (sum (filter divisible_by_3_or_5 [1..999]))