Skip to content

@23Skidoo /Fibs.hs
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fibonacci
{-# 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.