Skip to content

Instantly share code, notes, and snippets.

@cmoore
Created October 7, 2009 06:57
Show Gist options
  • Save cmoore/203829 to your computer and use it in GitHub Desktop.
Save cmoore/203829 to your computer and use it in GitHub Desktop.
module Main where
import Text.Printf
import Control.Monad
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
main = forM_ [0..45] $ \x ->
printf "n=%d => %d\n" x (fib x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment