fizzBuzz x = if null str then show x else str
where str = concat [tag | (n,tag) <- tags, x `rem` n == 0]
tags = [(3,"Fizz"), (5,"Buzz")]
main = mapM_ (putStrLn . fizzBuzz) [1..100]
Extendable. fizzBuzz x = if null str then show x else str
where str = concat [tag | (n,tag) <- tags, x `rem` n == 0]
tags = [(3,"Fizz"), (5,"Buzz")]
main = mapM_ (putStrLn . fizzBuzz) [1..100]
Extendable.