Skip to content

Instantly share code, notes, and snippets.

Created Sep 11, 2015
What would you like to do?
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