Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. fizzBuzz :: [Int] -> [String]
  2. fizzBuzz listOfNumbers = [fizzify x | x <- listOfNumbers]
  3. where
  4. fizzify :: Int -> String
  5. fizzify num
  6. | fizz && buzz = "FizzBuzz"
  7. | fizz = "Fizz"
  8. | buzz = "Buzz"
  9. | otherwise = show num
  10. where fizz = num `mod` 3 == 0
  11. buzz = num `mod` 5 == 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement