Created
May 20, 2014 19:31
-
-
Save depy/49fee95a49525a729e91 to your computer and use it in GitHub Desktop.
This file contains 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
main :: IO() | |
main = mapM_ putStrLn $ take 30 fizzBuzz | |
fizzBuzz = let nums = map show [1..] | |
fizzs = cycle $ ["", "", "Fizz"] | |
buzzs = cycle $ ["", "", "", "", "Buzz"] | |
in zipWith3 (\f b n -> if f++b == "" then n else f++b) fizzs buzzs nums |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment