Skip to content

Instantly share code, notes, and snippets.

@LukaHorvat
Created November 17, 2014 21:59
Show Gist options
  • Save LukaHorvat/06a3bf06b60a8f659306 to your computer and use it in GitHub Desktop.
Save LukaHorvat/06a3bf06b60a8f659306 to your computer and use it in GitHub Desktop.
fib :: Int -> Int
fib = memo fib'
where fib' 0 = 1
fib' 1 = 1
fib' n = fib' (n - 1) + fib' (n - 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment