:: Monoid m => Bool -> m -> m package:ihaskell

If the first argument evaluates to True, then the result is the second argument. Otherwise an AssertionFailed exception is raised, containing a String with the source file and line number of the call to assert. Assertions can normally be turned on or off with a compiler flag (for GHC, assertions are normally on unless optimisation is turned on with -O or the -fignore-asserts option is given). When assertions are turned off, the first argument to assert is ignored, and the second argument is returned as the result.
This is a valid definition of stimes for an idempotent Monoid. When mappend x x = x, this definition should be preferred, because it works in <math> rather than <math>
This is a valid definition of stimes for a Monoid. Unlike the default definition of stimes, it is defined for 0 and so it should be preferred where possible.
Repeat a value n times.
mtimesDefault n a = a <> a <> ... <> a  -- using <> (n-1) times
In many cases, `stimes 0 a` for a Monoid will produce mempty. However, there are situations when it cannot do so. In particular, the following situation is fairly common:
data T a = ...

class Constraint1 a
class Constraint1 a => Constraint2 a
instance Constraint1 a => Semigroup (T a) instance Constraint2 a => Monoid (T a) @ Since Constraint1 is insufficient to implement mempty, stimes for T a cannot do so. When working with such a type, or when working polymorphically with Semigroup instances, mtimesDefault should be used when the multiplier might be zero. It is implemented using stimes when the multiplier is nonzero and mempty when it is zero.