Skip to content

Instantly share code, notes, and snippets.

@depy
Created May 20, 2014 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save depy/49fee95a49525a729e91 to your computer and use it in GitHub Desktop.
Save depy/49fee95a49525a729e91 to your computer and use it in GitHub Desktop.
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