monoid-subclasses-1.2.5.1: 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
  - null :: m -> Bool
- 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

Nothing

Methods

null :: m -> Bool #

default null :: Eq m => m -> Bool #

#### Instances

Instances details

MonoidNull ByteString # |
Instance details Defined in Data.Monoid.Null Methods null :: ByteString -> Bool #
MonoidNull ByteString # |
Instance details Defined in Data.Monoid.Null Methods null :: ByteString -> Bool #
MonoidNull IntSet # |
Instance details Defined in Data.Monoid.Null Methods null :: IntSet -> Bool #
MonoidNull All # |
Instance details Defined in Data.Monoid.Null Methods null :: All -> Bool #
MonoidNull Any # |
Instance details Defined in Data.Monoid.Null Methods null :: Any -> Bool #
MonoidNull Ordering # |
Instance details Defined in Data.Monoid.Null Methods null :: Ordering -> Bool #
MonoidNull ByteStringUTF8 # | O(1)
Instance details Defined in Data.Monoid.Instances.ByteString.UTF8 Methods null :: ByteStringUTF8 -> Bool #
MonoidNull Text # |
Instance details Defined in Data.Monoid.Null Methods null :: Text -> Bool #
MonoidNull Text # |
Instance details Defined in Data.Monoid.Null Methods null :: Text -> Bool #
MonoidNull () # |
Instance details Defined in Data.Monoid.Null Methods null :: () -> Bool #
(Ord a, Bounded a) => MonoidNull (Max a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Max a -> Bool #
(Ord a, Bounded a) => MonoidNull (Min a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Min a -> Bool #
MonoidNull a => MonoidNull (WrappedMonoid a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: WrappedMonoid a -> Bool #
MonoidNull (IntMap v) # |
Instance details Defined in Data.Monoid.Null Methods null :: IntMap v -> Bool #
MonoidNull (Seq a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Seq a -> Bool #
Ord a => MonoidNull (Set a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Set a -> Bool #
MonoidNull a => MonoidNull (Identity a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Identity a -> Bool #
MonoidNull (First a) # |
Instance details Defined in Data.Monoid.Null Methods null :: First a -> Bool #
MonoidNull (Last a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Last a -> Bool #
MonoidNull a => MonoidNull (Down a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Down a -> Bool #
MonoidNull a => MonoidNull (Dual a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Dual a -> Bool #
(Num a, Eq a) => MonoidNull (Product a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Product a -> Bool #
(Num a, Eq a) => MonoidNull (Sum a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Sum a -> Bool #
MonoidNull p => MonoidNull (Par1 p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Par1 p -> Bool #
PositiveMonoid a => MonoidNull (Concat a) # |
Instance details Defined in Data.Monoid.Instances.Concat Methods null :: Concat a -> Bool #
(StableFactorial a, Monoid a) => MonoidNull (Measured a) # |
Instance details Defined in Data.Monoid.Instances.Measured Methods null :: Measured a -> Bool #
(StableFactorial m, TextualMonoid m, MonoidNull m) => MonoidNull (LinePositioned m) # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods null :: LinePositioned m -> Bool #
(StableFactorial m, FactorialMonoid m) => MonoidNull (OffsetPositioned m) # |
Instance details Defined in Data.Monoid.Instances.Positioned Methods null :: OffsetPositioned m -> Bool #
(MonoidNull m, StableFactorial m) => MonoidNull (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory Methods null :: Shadowed m -> Bool #
MonoidNull (Vector a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Vector a -> Bool #
Monoid a => MonoidNull (Maybe a) # |
Instance details Defined in Data.Monoid.Null Methods null :: Maybe a -> Bool #
MonoidNull [x] # |
Instance details Defined in Data.Monoid.Null Methods null :: [x] -> Bool #
Ord k => MonoidNull (Map k v) # |
Instance details Defined in Data.Monoid.Null Methods null :: Map k v -> Bool #
MonoidNull (Proxy a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Proxy a -> Bool #
MonoidNull (U1 p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: U1 p -> Bool #
(MonoidNull a, MonoidNull b) => MonoidNull (Stateful a b) # |
Instance details Defined in Data.Monoid.Instances.Stateful Methods null :: Stateful a b -> Bool #
(MonoidNull a, MonoidNull b) => MonoidNull (a, b) # |
Instance details Defined in Data.Monoid.Null Methods null :: (a, b) -> Bool #
MonoidNull r => MonoidNull (Const r a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Const r a -> Bool #
MonoidNull (f p) => MonoidNull (Rec1 f p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Rec1 f p -> Bool #
(MonoidNull a, MonoidNull b, MonoidNull c) => MonoidNull (a, b, c) # |
Instance details Defined in Data.Monoid.Null Methods null :: (a, b, c) -> Bool #
(MonoidNull (f a), MonoidNull (g a)) => MonoidNull (Product f g a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Product f g a -> Bool #
(MonoidNull (f p), MonoidNull (g p)) => MonoidNull ((f :*: g) p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: (f :*: g) p -> Bool #
MonoidNull c => MonoidNull (K1 i c p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: K1 i c p -> Bool #
(MonoidNull a, MonoidNull b, MonoidNull c, MonoidNull d) => MonoidNull (a, b, c, d) # |
Instance details Defined in Data.Monoid.Null Methods null :: (a, b, c, d) -> Bool #
MonoidNull (f (g a)) => MonoidNull (Compose f g a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: Compose f g a -> Bool #
MonoidNull (f (g p)) => MonoidNull ((f :.: g) p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: (f :.: g) p -> Bool #
MonoidNull (f p) => MonoidNull (M1 i c f p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: M1 i c f p -> Bool #
(MonoidNull a, MonoidNull b, MonoidNull c, MonoidNull d, MonoidNull e) => MonoidNull (a, b, c, d, e) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null Methods null :: (a, b, c, d, e) -> 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

Instances details

PositiveMonoid ByteString # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid ByteString # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid IntSet # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid All # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid Any # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid Ordering # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid ByteStringUTF8 # |
Instance details Defined in Data.Monoid.Instances.ByteString.UTF8
PositiveMonoid Text # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid Text # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid () # |
Instance details Defined in Data.Monoid.Null
(Ord a, Bounded a) => PositiveMonoid (Max a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
(Ord a, Bounded a) => PositiveMonoid (Min a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid a => PositiveMonoid (WrappedMonoid a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (IntMap v) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid (Seq a) # |
Instance details Defined in Data.Monoid.Null
Ord a => PositiveMonoid (Set a) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid a => PositiveMonoid (Identity a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (First a) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid (Last a) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid a => PositiveMonoid (Down a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid a => PositiveMonoid (Dual a) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid (Product Natural) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid (Sum Natural) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid p => PositiveMonoid (Par1 p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid a => PositiveMonoid (Concat a) # |
Instance details Defined in Data.Monoid.Instances.Concat
(StableFactorial a, Monoid a) => PositiveMonoid (Measured a) # |
Instance details Defined in Data.Monoid.Instances.Measured
(StableFactorial m, TextualMonoid m) => PositiveMonoid (LinePositioned m) # |
Instance details Defined in Data.Monoid.Instances.Positioned
(StableFactorial m, FactorialMonoid m) => PositiveMonoid (OffsetPositioned m) # |
Instance details Defined in Data.Monoid.Instances.Positioned
(PositiveMonoid m, StableFactorial m) => PositiveMonoid (Shadowed m) # |
Instance details Defined in Data.Monoid.Instances.PrefixMemory
PositiveMonoid (Vector a) # |
Instance details Defined in Data.Monoid.Null
Monoid a => PositiveMonoid (Maybe a) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid [x] # |
Instance details Defined in Data.Monoid.Null
Ord k => PositiveMonoid (Map k v) # |
Instance details Defined in Data.Monoid.Null
PositiveMonoid (Proxy a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (U1 p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
(PositiveMonoid a, PositiveMonoid b) => PositiveMonoid (Stateful a b) # |
Instance details Defined in Data.Monoid.Instances.Stateful
PositiveMonoid r => PositiveMonoid (Const r a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (f p) => PositiveMonoid (Rec1 f p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid c => PositiveMonoid (K1 i c p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (f (g a)) => PositiveMonoid (Compose f g a) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (f (g p)) => PositiveMonoid ((f :.: g) p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null
PositiveMonoid (f p) => PositiveMonoid (M1 i c f p) # | Since: 1.2.5.0
Instance details Defined in Data.Monoid.Null