Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
This module defines the MonoidNull class and some of its instances.
- class Monoid m => MonoidNull m where
- class MonoidNull m => PositiveMonoid m
Documentation
class Monoid m => MonoidNull m where Source #
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.
class MonoidNull m => PositiveMonoid m Source #
Subclass of Monoid
for types whose values have no inverse, with the exception of mempty
. More
formally, the class instances must satisfy the following law:
null (x <> y) == (null x && null y)