Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active May 27, 2017 21:10
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 deque-blog/3439095c2fdb968e6947b71cd9761d77 to your computer and use it in GitHub Desktop.
Save deque-blog/3439095c2fdb968e6947b71cd9761d77 to your computer and use it in GitHub Desktop.
fiboRecur :: Int -> Integer
fiboRecur = loop 0 1
where
loop !curr !next n
| n == 0 = curr
| otherwise = loop next (curr + next) (n - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment