Data.Monoid.Extra
Contents
Description
Extra functions for working with monoids.
module Data.Monoid
mwhen :: Monoid a => Bool -> a -> a Source #
Like when, but operating on a Monoid. If the first argument is True returns the second, otherwise returns mempty.
when
Monoid
True
mempty
mwhen True "test" == "test" mwhen False "test" == ""