import Control.Monad
import Data.List (intercalate)
facs :: [Integer]
facs = 1 : 1 : 2 : 6 : zipWith (*) [4 ..] (drop 2 . tail $ facs)
fibs :: [Integer]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
main = do
print'' facs "fac" 90
putStrLn $ replicate 80 '-'
print'' fibs "fib" 110
where
print' f (a, b) = putStrLn $ intercalate " " [f, (show a), (show b)]
print'' f name n =
sequence_ . take n . map (print' name) . zipWith (,) [0 ..] $ f