2 ms·
fizzbuzzbazz = mconcat [ 3 ~> "Fizz" , 5 ~> "Buzz" , 7 ~> "Bazz" ] Also, I believe you should have something like main = mapM_ put
by wz1000 9y ago
fizzbuzzbazz = mconcat
[ 3 ~> "Fizz"
, 5 ~> "Buzz"
, 7 ~> "Bazz"
]
Also, I believe you should have something like
main = mapM_ putStrLn $ map (fromMaybe . show <*> fizzbuzz) [1..100]
to print out the number when it isn't matched by any of the rules.
- pja 9y agoPoint! I did have something like that in the original version, but was experimenting with other approaches and lost the digits somewhere along the way.