Last active
November 15, 2016 01:46
-
-
Save kaveet/924cd0991f320d2195c6823940175725 to your computer and use it in GitHub Desktop.
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
-- fibonacci.hs | |
-- credit dtb@stackoverflow http://stackoverflow.com/a/1105840 | |
-- Accessing the n-th fibonacci number: fib n = fibs !! n | |
module Fibonacci where | |
fib :: Integer -> Integer | |
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