Skip to content

Instantly share code, notes, and snippets.

@skylerto
Created February 18, 2016 20:14
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 skylerto/13f8f39773548b2e3c7b to your computer and use it in GitHub Desktop.
Save skylerto/13f8f39773548b2e3c7b to your computer and use it in GitHub Desktop.
import Data.List
list = 1 : 1 : [a + b | (a,b) <- zip list $ tail list]
fib :: Int -> Int
fib n = last $ take n list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment