Skip to content

Instantly share code, notes, and snippets.

@nakal
Created September 11, 2015 23:49
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 nakal/9c0c537478aaeea0fd1a to your computer and use it in GitHub Desktop.
Save nakal/9c0c537478aaeea0fd1a to your computer and use it in GitHub Desktop.
Fibonacci stuff
-- return the nth fibonacci number
fib n = fst $ (foldr1 (.) (replicate n $ \(f1, f2) -> (f2, f1 + f2) )) (0,1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment