Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Fibonacci

View Fibs.hs
1 2 3 4 5 6 7 8 9 10 11 12 13
{-# LANGUAGE BangPatterns #-}
 
module Main where
 
zipWith' :: (t -> t1 -> a) -> [t] -> [t1] -> [a]
zipWith' f (!x:xs) (!y:ys) = f x y : zipWith' f xs ys
zipWith' _ _ _ = []
 
fibs :: [Integer]
fibs = 0 : 1 : zipWith' (+) fibs (tail fibs)
 
main :: IO ()
main = print . head . drop (10^6) $ fibs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.