Create a gist now

Instantly share code, notes, and snippets.

Fast fib
fib :: Int -> Integer
fib n = fib' n 0 1
where
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