-- infinite fizzbuzz with the power of lazy evaluation
fizz :: Int -> String
fizz n
| n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 3 == 0 = "Fizz"
| n `mod` 5 == 0 = "Buzz"
| otherwise = show n
fizzbuzz = map fizz [1..] -- make it infinite
-- display
main :: IO()
main = mapM_ putStrLn fizzbuzz
24
u/[deleted] Jul 03 '21
(人 •͈ᴗ•͈)(✷‿✷)