Yet another FizzBuzz in Haskell Time for the most original question of the year: writing a FizzBuzz in Haskell!

So here is what I came up with:

fizzBuzz :: [Int] -&gt; [String]
fizzBuzz xs =
    [fizz x | x &lt;- xs]

fizz :: Int -&gt; String
fizz x
    | mod x 15 == 0  = "FizzBuzz"
    | mod x 3 == 0   = "Fizz"
    | mod x 5 == 0   = "Buzz"
    | otherwise      = show x


Then I can call

&gt; mapM_ print $ fizzBuzz [1..15]
"1"
"2"
"Fizz"
"4"
"Buzz"
etc


My questions are:


What are obvious awkwardnesses in this code?
How could I mix fizzBuzz and fizz so that there's only one function?
In fizz, is it possible to use a string buffer so that I get rid of the mod x 15 == 0 guard, taking advantage of its redundancy with mod 3 x == 0 and mod 5 x == 0?
[fizz x | x &lt;- xs] is the same as map fizz xs, so fizzBuzz = map fizz.

You can use putStrLn instead of print to print strings without quotes.

Using the fact that map (g . f) = map g . map f,  you can merge mapM_ putStrLn and map fizz into:

mapM_ (putStrLn . fizz) [1..15]




Another solution with everything in single function and without mod x 15:

import Control.Monad (forM_, when)

fizzBuzz :: IO ()
fizzBuzz = forM_ [1..15] $ \x -&gt; do
  let [m3, m5] = map ((==0) . mod x) [3,5]
  when m3 $ putStr "Fizz"
  when m5 $ putStr "Buzz"
  when (not m3 &amp;&amp; not m5) $ putStr $ show x
  putStrLn ""