Monoid -is:module

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following: You can alternatively define mconcat instead of mempty, in which case the laws are: The method names refer to the monoid of lists under concatenation, but there are many other instances. Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product. NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following: The method names refer to the monoid of lists under concatenation, but there are many other instances. Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product. NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
  • mappend mempty x = x
  • mappend x mempty = x
  • mappend x (mappend y z) = mappend (mappend x y) z
  • mconcat = foldr mappend mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances. Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.
Properties to check that the Monoid a satisfies the monoid properties. The argument value is ignored and is present only for its type.
Not on Stackage, so not searched. Monoid type classes, designed in modular way, distinguish Monoid from Mempty and Semigroup. This design allows mempty operation don't bring Semigroups related constraints until (<>) is used.
Explicit Monoid dictionary. Doesn't have to correspond to an actual Monoid instance, though see monoidD.
For base < 4.11, the Monoid' constraint is a synonym for things which are instances of both Semigroup and Monoid. For base version 4.11 and onwards, Monoid has Semigroup as a superclass already, so for backwards compatibility Monoid' is provided as a synonym for Monoid.
Extension of Monoid that allows testing a value for equality with mempty. The following law must hold:
null x == (x == mempty)
Furthermore, the performance of this method should be constant, i.e., independent of the length of its argument.
A HashMap with monoidal accumulation
An IntMap with monoidal accumulation
A Map with monoidal accumulation
An additive monoid
zero + a = a = a + zero
Invariant monoidal functor. This roughly corresponds to Applicative, which, for covariant functors, is equivalent to a monoidal functor. Invariant functors, however, may admit a monoidal instance but not applicative.
Monoidal functors that allow choice.