From b2e1e0649924dcbed3ad111f51f3439ce945a120 Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Mon, 26 Oct 2020 22:42:26 -0700 Subject: [PATCH] haskell 002 --- haskell/euler002.hs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 haskell/euler002.hs diff --git a/haskell/euler002.hs b/haskell/euler002.hs new file mode 100644 index 0000000..fb80a17 --- /dev/null +++ b/haskell/euler002.hs @@ -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)))