haskell 002

master
Evan Hemsley 2020-10-26 22:42:26 -07:00
parent 46b96327d5
commit b2e1e06499
1 changed files with 6 additions and 0 deletions

6
haskell/euler002.hs Normal file
View File

@ -0,0 +1,6 @@
module Main where
fibonacci = map fst (iterate (\(n, m) -> (m, n+m)) (0, 1))
main = do
print (sum (filter even (takeWhile (<4000000) fibonacci)))