Skip to content

Instantly share code, notes, and snippets.

@joshrotenberg
Created April 11, 2013 17:47
Show Gist options
  • Select an option

  • Save joshrotenberg/5365547 to your computer and use it in GitHub Desktop.

Select an option

Save joshrotenberg/5365547 to your computer and use it in GitHub Desktop.
fizzBuzz :: (Integral a, Show a) => a -> String
fizzBuzz n
| n `mod` 3 == 0 && n `mod` 5 == 0 = "FizzBuzz"
| n `mod` 3 == 0 = "Fizz"
| n `mod` 5 == 0 = "Buzz"
| otherwise = show n
-- [fizzBuzz x | x <- [1..100]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment