Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fast fib
fib :: Int -> Integer
fib n = fib' n 0 1
fib' 0 x _ = x
fib' m x y = fib' (m - 1) y (x + y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.