Skip to content

Instantly share code, notes, and snippets.

@ts95
Last active December 27, 2015 02:59
Show Gist options
  • Save ts95/7256129 to your computer and use it in GitHub Desktop.
Save ts95/7256129 to your computer and use it in GitHub Desktop.
Fibonacci Sequence, Haskell.
import Data.List
fib :: Int -> Int
fib 0 = 1
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
main :: IO ()
main = putStrLn $ intercalate ", " $ map show $ map fib [0..10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment