Source

ProjectEuler / Haskell / 025 / solution1.hs

Full commit
OJ Reeves e370a36 












fibs :: [Integer]
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)

firstFib :: (Num t) => Int -> t
firstFib size = f' size 1 fibs
    where
        f' s i (f:fs) | length (show f) == s = i
                      | otherwise = f' s (i + 1) fs

solution :: Integer
solution = firstFib 1000

main :: IO ()
main = print solution