monoid-subclasses-0.4.4: Subclasses of Monoid

Safe Haskell | Trustworthy
Language | Haskell2010

Data.Monoid.Null

Description

This module defines the MonoidNull class and some of its instances.

Synopsis

- class Monoid m => MonoidNull m where
- class MonoidNull m => PositiveMonoid m

# Documentation

class Monoid m => MonoidNull m where #

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.

Minimal complete definition

null

Methods

null :: m -> Bool #

Instances

MonoidNull Ordering # |
Methods null :: Ordering -> Bool #
MonoidNull () # |
Methods null :: () -> Bool #
MonoidNull All # |
Methods null :: All -> Bool #
MonoidNull Any # |
Methods null :: Any -> Bool #
MonoidNull ByteString # |
Methods null :: ByteString -> Bool #
MonoidNull ByteString # |
Methods null :: ByteString -> Bool #
MonoidNull IntSet # |
Methods null :: IntSet -> Bool #
MonoidNull Text # |
Methods null :: Text -> Bool #
MonoidNull Text # |
Methods null :: Text -> Bool #
MonoidNull ByteStringUTF8 # |
Methods null :: ByteStringUTF8 -> Bool #
MonoidNull [x] # |
Methods null :: [x] -> Bool #
Monoid a => MonoidNull (Maybe a) # |
Methods null :: Maybe a -> Bool #
MonoidNull a => MonoidNull (Dual a) # |
Methods null :: Dual a -> Bool #
(Num a, Eq a) => MonoidNull (Sum a) # |
Methods null :: Sum a -> Bool #
(Num a, Eq a) => MonoidNull (Product a) # |
Methods null :: Product a -> Bool #
MonoidNull (First a) # |
Methods null :: First a -> Bool #
MonoidNull (Last a) # |
Methods null :: Last a -> Bool #
MonoidNull (IntMap v) # |
Methods null :: IntMap v -> Bool #
MonoidNull (Seq a) # |
Methods null :: Seq a -> Bool #
Ord a => MonoidNull (Set a) # |
Methods null :: Set a -> Bool #
MonoidNull (Vector a) # |
Methods null :: Vector a -> Bool #
PositiveMonoid a => MonoidNull (Concat a) # |
Methods null :: Concat a -> Bool #
StableFactorialMonoid a => MonoidNull (Measured a) # |
Methods null :: Measured a -> Bool #
(StableFactorialMonoid m, TextualMonoid m, MonoidNull m) => MonoidNull (LinePositioned m) # |
Methods null :: LinePositioned m -> Bool #
(StableFactorialMonoid m, MonoidNull m) => MonoidNull (OffsetPositioned m) # |
Methods null :: OffsetPositioned m -> Bool #
(MonoidNull a, MonoidNull b) => MonoidNull (a, b) # |
Methods null :: (a, b) -> Bool #
Ord k => MonoidNull (Map k v) # |
Methods null :: Map k v -> Bool #
(MonoidNull a, MonoidNull b) => MonoidNull (Stateful a b) # |
Methods null :: Stateful a b -> Bool #
(MonoidNull a, MonoidNull b, MonoidNull c) => MonoidNull (a, b, c) # |
Methods null :: (a, b, c) -> Bool #
(MonoidNull a, MonoidNull b, MonoidNull c, MonoidNull d) => MonoidNull (a, b, c, d) # |
Methods null :: (a, b, c, d) -> Bool #

class MonoidNull m => PositiveMonoid m #

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)

Instances

PositiveMonoid Ordering # |
PositiveMonoid () # |
PositiveMonoid All # |
PositiveMonoid Any # |
PositiveMonoid ByteString # |
PositiveMonoid ByteString # |
PositiveMonoid IntSet # |
PositiveMonoid Text # |
PositiveMonoid Text # |
PositiveMonoid ByteStringUTF8 # |
PositiveMonoid [x] # |
Monoid a => PositiveMonoid (Maybe a) # |
PositiveMonoid a => PositiveMonoid (Dual a) # |
PositiveMonoid (First a) # |
PositiveMonoid (Last a) # |
PositiveMonoid (IntMap v) # |
PositiveMonoid (Seq a) # |
Ord a => PositiveMonoid (Set a) # |
PositiveMonoid (Vector a) # |
PositiveMonoid a => PositiveMonoid (Concat a) # |
StableFactorialMonoid a => PositiveMonoid (Measured a) # |
(StableFactorialMonoid m, TextualMonoid m) => PositiveMonoid (LinePositioned m) # |
StableFactorialMonoid m => PositiveMonoid (OffsetPositioned m) # |
Ord k => PositiveMonoid (Map k v) # |
(PositiveMonoid a, PositiveMonoid b) => PositiveMonoid (Stateful a b) # |