Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created September 1, 2018 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzo/efcdbef4ab8e483d667573c58ba41323 to your computer and use it in GitHub Desktop.
Save lorenzo/efcdbef4ab8e483d667573c58ba41323 to your computer and use it in GitHub Desktop.
fib :: Int -> Int
fib n =
let fib = 0:1:zipWith (+) fib (tail fib)
in fib!!n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment