module Main where main :: IO () main = interact fizzbuzz fizzbuzz :: String -> String fizzbuzz = unlines . (`take` fzbz) . read fzbz :: [String] fzbz = zipWith f [1..] (zipWith (++) fz bz) where f n "" = show n f _ fb = fb fz :: [String] fz = tail (cycle (take 3 ("Fizz" : repeat ""))) bz :: [String] bz = tail (cycle (take 5 ("Buzz" : repeat "")))