Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Last active August 29, 2015 13:59
Show Gist options
  • Save valyakuttan/10575007 to your computer and use it in GitHub Desktop.
Save valyakuttan/10575007 to your computer and use it in GitHub Desktop.
import Control.Monad
main :: IO ()
main = forM_ [1..100] $ \n -> do
let f n = case (n `mod` 2, n `mod` 5) of
(0,0) -> "fizzbuzz"
(0,_) -> "fizz"
(_,0) -> "buzz"
_ -> show n
putStrLn $ f n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment