Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fizzBuzz :: [Int] -> [String]
fizzBuzz listOfNumbers = [fizzify x | x <- listOfNumbers]
where
fizzify :: Int -> String
fizzify num
| fizz && buzz = "FizzBuzz"
| fizz = "Fizz"
| buzz = "Buzz"
| otherwise = show num
where fizz = num `mod` 3 == 0
buzz = num `mod` 5 == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.