Skip to content

Instantly share code, notes, and snippets.

@mdippery
Last active December 16, 2015 21:20
Show Gist options
  • Save mdippery/5498643 to your computer and use it in GitHub Desktop.
Save mdippery/5498643 to your computer and use it in GitHub Desktop.
FizzBuzz in Haskell
fizzBuzz n
| n `rem` 5 == 0 && n `rem` 3 == 0 = "FizzBuzz"
| n `rem` 5 == 0 = "Buzz"
| n `rem` 3 == 0 = "Fizz"
| otherwise = show n
main = putStr $ unlines $ map fizzBuzz [1..100]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment