I was inspired to play with FizzBuzz after taking a gander at codepad.org, and found myself wanting some function:
mwhen :: MonadPlus m => Bool -> a -> m a
mwhen b = if b then return else const mzero
just so I could do mwhen (n /? 3) "Foo" `mappend` mwhen (n /? 5) "Bar"
I expected it to be up on hoogle, but no dice.
Is this not as useful as I'd think it'd be?