Created
September 19, 2013 20:15
-
-
Save jsl/6629210 to your computer and use it in GitHub Desktop.
FizzBuzz Haskell Version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toFizzBuzz :: Integer -> String | |
toFizzBuzz n | |
| n `mod` 3 == 0 = "Fizz" | |
| n `mod` 5 == 0 = "Buzz" | |
| otherwise = show n | |
fizzBuzzSeries :: [String] | |
fizzBuzzSeries = map toFizzBuzz [1..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment