Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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