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.
MonoidNull Ordering | |
MonoidNull () | |
MonoidNull All | |
MonoidNull Any | |
MonoidNull ByteString | |
MonoidNull ByteString | |
MonoidNull IntSet | |
MonoidNull Text | |
MonoidNull Text | |
MonoidNull ByteStringUTF8 | |
MonoidNull [x] | |
MonoidNull a => MonoidNull (Dual a) | |
(Num a, Eq a) => MonoidNull (Sum a) | |
(Num a, Eq a) => MonoidNull (Product a) | |
MonoidNull (First a) | |
MonoidNull (Last a) | |
Monoid a => MonoidNull (Maybe a) | |
MonoidNull (IntMap v) | |
Ord a => MonoidNull (Set a) | |
MonoidNull (Seq a) | |
MonoidNull (Vector a) | |
MonoidNull (Concat a) | |
StableFactorialMonoid a => MonoidNull (Measured a) | |
(StableFactorialMonoid m, TextualMonoid m, MonoidNull m) => MonoidNull (LinePositioned m) | |
(StableFactorialMonoid m, MonoidNull m) => MonoidNull (OffsetPositioned m) | |
(MonoidNull a, MonoidNull b) => MonoidNull (a, b) | |
Ord k => MonoidNull (Map k v) | |
Monoid b => MonoidNull (TagSoup a b) | |
(MonoidNull a, MonoidNull b) => MonoidNull (Stateful a b) |
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)
PositiveMonoid Ordering | |
PositiveMonoid () | |
PositiveMonoid All | |
PositiveMonoid Any | |
PositiveMonoid ByteString | |
PositiveMonoid ByteString | |
PositiveMonoid IntSet | |
PositiveMonoid Text | |
PositiveMonoid Text | |
PositiveMonoid ByteStringUTF8 | |
PositiveMonoid [x] | |
PositiveMonoid a => PositiveMonoid (Dual a) | |
PositiveMonoid (First a) | |
PositiveMonoid (Last a) | |
Monoid a => PositiveMonoid (Maybe a) | |
PositiveMonoid (IntMap v) | |
Ord a => PositiveMonoid (Set a) | |
PositiveMonoid (Seq a) | |
PositiveMonoid (Vector a) | |
PositiveMonoid (Concat a) | |
StableFactorialMonoid a => PositiveMonoid (Measured a) | |
(StableFactorialMonoid m, TextualMonoid m, PositiveMonoid m) => PositiveMonoid (LinePositioned m) | |
(StableFactorialMonoid m, PositiveMonoid m) => PositiveMonoid (OffsetPositioned m) | |
Ord k => PositiveMonoid (Map k v) | |
Monoid b => PositiveMonoid (TagSoup a b) | |
(PositiveMonoid a, PositiveMonoid b) => PositiveMonoid (Stateful a b) |