-- fizzbuzz.hs -- FizzBuzz example in Haskell
module Main where

checkFizzBuzz :: Integer -> String
checkFizzBuzz n = if (n `rem` 3 == 0) && (n `rem` 5 == 0)
                  then "fizzbuzz"
                  else if (n `rem` 3 == 0)
                       then "fizz"
                       else if (n `rem` 5 == 0)
                       then "buzz"
                       else show n

fizzbuzz :: Integer -> Integer -> [String]
fizzbuzz x y = [checkFizzBuzz n | n <- [x..y]]

main = mapM putStrLn (fizzbuzz 1 100)
