Created
September 11, 2015 23:49
-
-
Save nakal/9c0c537478aaeea0fd1a to your computer and use it in GitHub Desktop.
Fibonacci stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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