alg-0.2.13.1: Algebraic structures

Algebra

Synopsis

# Documentation

class Semigroup a where Source #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the associativity law:

• x <> (y <> z) = (x <> y) <> z

Since: base-4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 Source #

An associative operation.

sconcat :: NonEmpty a -> a Source #

Reduce a non-empty list with <>

The default definition should be sufficient, but this can be overridden for efficiency.

stimes :: Integral b => b -> a -> a Source #

Repeat a value n times.

Given that this works on a Semigroup it is allowed to fail if you request 0 or fewer repetitions, and the default definition will do so.

By making this a member of the class, idempotent semigroups and monoids can upgrade this to execute in O(1) by picking stimes = stimesIdempotent or stimes = stimesIdempotentMonoid respectively.

Instances
 Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsstimes :: Integral b => b -> Ordering -> Ordering Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: () -> () -> () Source #sconcat :: NonEmpty () -> () Source #stimes :: Integral b => b -> () -> () Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: All -> All -> All Source #stimes :: Integral b => b -> All -> All Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Any -> Any -> Any Source #stimes :: Integral b => b -> Any -> Any Source # Semigroup [a] Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: [a] -> [a] -> [a] Source #sconcat :: NonEmpty [a] -> [a] Source #stimes :: Integral b => b -> [a] -> [a] Source # Semigroup a => Semigroup (Maybe a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: Maybe a -> Maybe a -> Maybe a Source #sconcat :: NonEmpty (Maybe a) -> Maybe a Source #stimes :: Integral b => b -> Maybe a -> Maybe a Source # Semigroup a => Semigroup (IO a) Since: base-4.10.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: IO a -> IO a -> IO a Source #sconcat :: NonEmpty (IO a) -> IO a Source #stimes :: Integral b => b -> IO a -> IO a Source # Semigroup p => Semigroup (Par1 p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: Par1 p -> Par1 p -> Par1 p Source #sconcat :: NonEmpty (Par1 p) -> Par1 p Source #stimes :: Integral b => b -> Par1 p -> Par1 p Source # Ord a => Semigroup (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Min a -> Min a -> Min a Source #sconcat :: NonEmpty (Min a) -> Min a Source #stimes :: Integral b => b -> Min a -> Min a Source # Ord a => Semigroup (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Max a -> Max a -> Max a Source #sconcat :: NonEmpty (Max a) -> Max a Source #stimes :: Integral b => b -> Max a -> Max a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: First a -> First a -> First a Source #sconcat :: NonEmpty (First a) -> First a Source #stimes :: Integral b => b -> First a -> First a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Last a -> Last a -> Last a Source #sconcat :: NonEmpty (Last a) -> Last a Source #stimes :: Integral b => b -> Last a -> Last a Source # Monoid m => Semigroup (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsstimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m Source # Semigroup a => Semigroup (Option a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Option a -> Option a -> Option a Source #sconcat :: NonEmpty (Option a) -> Option a Source #stimes :: Integral b => b -> Option a -> Option a Source # Semigroup a => Semigroup (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methods(<>) :: Identity a -> Identity a -> Identity a Source #stimes :: Integral b => b -> Identity a -> Identity a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: First a -> First a -> First a Source #sconcat :: NonEmpty (First a) -> First a Source #stimes :: Integral b => b -> First a -> First a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: Last a -> Last a -> Last a Source #sconcat :: NonEmpty (Last a) -> Last a Source #stimes :: Integral b => b -> Last a -> Last a Source # Semigroup a => Semigroup (Dual a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Dual a -> Dual a -> Dual a Source #sconcat :: NonEmpty (Dual a) -> Dual a Source #stimes :: Integral b => b -> Dual a -> Dual a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Endo a -> Endo a -> Endo a Source #sconcat :: NonEmpty (Endo a) -> Endo a Source #stimes :: Integral b => b -> Endo a -> Endo a Source # Num a => Semigroup (Sum a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Sum a -> Sum a -> Sum a Source #sconcat :: NonEmpty (Sum a) -> Sum a Source #stimes :: Integral b => b -> Sum a -> Sum a Source # Num a => Semigroup (Product a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Product a -> Product a -> Product a Source #sconcat :: NonEmpty (Product a) -> Product a Source #stimes :: Integral b => b -> Product a -> Product a Source # Semigroup a => Semigroup (Down a) Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(<>) :: Down a -> Down a -> Down a Source #sconcat :: NonEmpty (Down a) -> Down a Source #stimes :: Integral b => b -> Down a -> Down a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a Source #stimes :: Integral b => b -> NonEmpty a -> NonEmpty a Source # Ord a => Semigroup (Min a) Source # Instance detailsDefined in Relation.Binary.Comparison Methods(<>) :: Min a -> Min a -> Min a Source #sconcat :: NonEmpty (Min a) -> Min a Source #stimes :: Integral b => b -> Min a -> Min a Source # Bits a => Semigroup (Min (BitSet a)) Source # Instance detailsDefined in Data.BitSet Methods(<>) :: Min (BitSet a) -> Min (BitSet a) -> Min (BitSet a) Source #sconcat :: NonEmpty (Min (BitSet a)) -> Min (BitSet a) Source #stimes :: Integral b => b -> Min (BitSet a) -> Min (BitSet a) Source # Ord a => Semigroup (Max a) Source # Instance detailsDefined in Relation.Binary.Comparison Methods(<>) :: Max a -> Max a -> Max a Source #sconcat :: NonEmpty (Max a) -> Max a Source #stimes :: Integral b => b -> Max a -> Max a Source # Bits a => Semigroup (Max (BitSet a)) Source # Instance detailsDefined in Data.BitSet Methods(<>) :: Max (BitSet a) -> Max (BitSet a) -> Max (BitSet a) Source #sconcat :: NonEmpty (Max (BitSet a)) -> Max (BitSet a) Source #stimes :: Integral b => b -> Max (BitSet a) -> Max (BitSet a) Source # Semigroup a => Semigroup (Lexical a) Source # Instance detailsDefined in Relation.Binary.Comparison Methods(<>) :: Lexical a -> Lexical a -> Lexical a Source #sconcat :: NonEmpty (Lexical a) -> Lexical a Source #stimes :: Integral b => b -> Lexical a -> Lexical a Source # Bits a => Semigroup (BitSet a) Source # Instance detailsDefined in Data.BitSet Methods(<>) :: BitSet a -> BitSet a -> BitSet a Source #sconcat :: NonEmpty (BitSet a) -> BitSet a Source #stimes :: Integral b => b -> BitSet a -> BitSet a Source # Semigroup b => Semigroup (a -> b) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a -> b) -> (a -> b) -> a -> b Source #sconcat :: NonEmpty (a -> b) -> a -> b Source #stimes :: Integral b0 => b0 -> (a -> b) -> a -> b Source # Semigroup (Either a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Either Methods(<>) :: Either a b -> Either a b -> Either a b Source #sconcat :: NonEmpty (Either a b) -> Either a b Source #stimes :: Integral b0 => b0 -> Either a b -> Either a b Source # Semigroup (V1 p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: V1 p -> V1 p -> V1 p Source #sconcat :: NonEmpty (V1 p) -> V1 p Source #stimes :: Integral b => b -> V1 p -> V1 p Source # Semigroup (U1 p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: U1 p -> U1 p -> U1 p Source #sconcat :: NonEmpty (U1 p) -> U1 p Source #stimes :: Integral b => b -> U1 p -> U1 p Source # (Semigroup a, Semigroup b) => Semigroup (a, b) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b) -> (a, b) -> (a, b) Source #sconcat :: NonEmpty (a, b) -> (a, b) Source #stimes :: Integral b0 => b0 -> (a, b) -> (a, b) Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Proxy Methods(<>) :: Proxy s -> Proxy s -> Proxy s Source #sconcat :: NonEmpty (Proxy s) -> Proxy s Source #stimes :: Integral b => b -> Proxy s -> Proxy s Source # (Applicative p, Semigroup a) => Semigroup (Ap p a) Instance detailsDefined in Util Methods(<>) :: Ap p a -> Ap p a -> Ap p a Source #sconcat :: NonEmpty (Ap p a) -> Ap p a Source #stimes :: Integral b => b -> Ap p a -> Ap p a Source # Semigroup (f p) => Semigroup (Rec1 f p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: Rec1 f p -> Rec1 f p -> Rec1 f p Source #sconcat :: NonEmpty (Rec1 f p) -> Rec1 f p Source #stimes :: Integral b => b -> Rec1 f p -> Rec1 f p Source # (Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #sconcat :: NonEmpty (a, b, c) -> (a, b, c) Source #stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) Source # Semigroup a => Semigroup (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(<>) :: Const a b -> Const a b -> Const a b Source #sconcat :: NonEmpty (Const a b) -> Const a b Source #stimes :: Integral b0 => b0 -> Const a b -> Const a b Source # (Applicative f, Semigroup a) => Semigroup (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: Ap f a -> Ap f a -> Ap f a Source #sconcat :: NonEmpty (Ap f a) -> Ap f a Source #stimes :: Integral b => b -> Ap f a -> Ap f a Source # Alternative f => Semigroup (Alt f a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Alt f a -> Alt f a -> Alt f a Source #sconcat :: NonEmpty (Alt f a) -> Alt f a Source #stimes :: Integral b => b -> Alt f a -> Alt f a Source # Semigroup c => Semigroup (K1 i c p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: K1 i c p -> K1 i c p -> K1 i c p Source #sconcat :: NonEmpty (K1 i c p) -> K1 i c p Source #stimes :: Integral b => b -> K1 i c p -> K1 i c p Source # (Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #sconcat :: NonEmpty ((f :*: g) p) -> (f :*: g) p Source #stimes :: Integral b => b -> (f :*: g) p -> (f :*: g) p Source # (Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) Source #stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) Source # Semigroup (f p) => Semigroup (M1 i c f p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #sconcat :: NonEmpty (M1 i c f p) -> M1 i c f p Source #stimes :: Integral b => b -> M1 i c f p -> M1 i c f p Source # Semigroup (f (g p)) => Semigroup ((f :.: g) p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methods(<>) :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #sconcat :: NonEmpty ((f :.: g) p) -> (f :.: g) p Source #stimes :: Integral b => b -> (f :.: g) p -> (f :.: g) p Source # (Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) Source #stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) Source # Semigroup (k3 b a) => Semigroup (Dual k3 a b) Instance detailsDefined in Control.Category.Dual Methods(<>) :: Dual k3 a b -> Dual k3 a b -> Dual k3 a b Source #sconcat :: NonEmpty (Dual k3 a b) -> Dual k3 a b Source #stimes :: Integral b0 => b0 -> Dual k3 a b -> Dual k3 a b Source #

class Semigroup a => Monoid a where Source #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

• x <> mempty = x
• mempty <> x = x
• x <> (y <> z) = (x <> y) <> z (Semigroup law)
• mconcat = foldr '(<>)' 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.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Methods

mempty :: a Source #

Identity of mappend

Instances
 Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmconcat :: [Ordering] -> Ordering Source # Monoid () Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: () Source #mappend :: () -> () -> () Source #mconcat :: [()] -> () Source # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: All -> All -> All Source #mconcat :: [All] -> All Source # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Any -> Any -> Any Source #mconcat :: [Any] -> Any Source # Monoid [a] Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: [a] Source #mappend :: [a] -> [a] -> [a] Source #mconcat :: [[a]] -> [a] Source # Semigroup a => Monoid (Maybe a) Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmappend :: Maybe a -> Maybe a -> Maybe a Source #mconcat :: [Maybe a] -> Maybe a Source # Monoid a => Monoid (IO a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsmappend :: IO a -> IO a -> IO a Source #mconcat :: [IO a] -> IO a Source # Monoid p => Monoid (Par1 p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmappend :: Par1 p -> Par1 p -> Par1 p Source #mconcat :: [Par1 p] -> Par1 p Source # (Ord a, Bounded a) => Monoid (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmappend :: Min a -> Min a -> Min a Source #mconcat :: [Min a] -> Min a Source # (Ord a, Bounded a) => Monoid (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmappend :: Max a -> Max a -> Max a Source #mconcat :: [Max a] -> Max a Source # Monoid m => Monoid (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmconcat :: [WrappedMonoid m] -> WrappedMonoid m Source # Semigroup a => Monoid (Option a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmappend :: Option a -> Option a -> Option a Source #mconcat :: [Option a] -> Option a Source # Monoid a => Monoid (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methodsmappend :: Identity a -> Identity a -> Identity a Source #mconcat :: [Identity a] -> Identity a Source # Monoid (First a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methodsmappend :: First a -> First a -> First a Source #mconcat :: [First a] -> First a Source # Monoid (Last a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methodsmappend :: Last a -> Last a -> Last a Source #mconcat :: [Last a] -> Last a Source # Monoid a => Monoid (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Dual a -> Dual a -> Dual a Source #mconcat :: [Dual a] -> Dual a Source # Monoid (Endo a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Endo a -> Endo a -> Endo a Source #mconcat :: [Endo a] -> Endo a Source # Num a => Monoid (Sum a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Sum a -> Sum a -> Sum a Source #mconcat :: [Sum a] -> Sum a Source # Num a => Monoid (Product a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Product a -> Product a -> Product a Source #mconcat :: [Product a] -> Product a Source # Monoid a => Monoid (Down a) Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodsmappend :: Down a -> Down a -> Down a Source #mconcat :: [Down a] -> Down a Source # Bits a => Monoid (Min (BitSet a)) Source # Instance detailsDefined in Data.BitSet Methodsmappend :: Min (BitSet a) -> Min (BitSet a) -> Min (BitSet a) Source #mconcat :: [Min (BitSet a)] -> Min (BitSet a) Source # Bits a => Monoid (Max (BitSet a)) Source # Instance detailsDefined in Data.BitSet Methodsmappend :: Max (BitSet a) -> Max (BitSet a) -> Max (BitSet a) Source #mconcat :: [Max (BitSet a)] -> Max (BitSet a) Source # Monoid a => Monoid (Lexical a) Source # Instance detailsDefined in Relation.Binary.Comparison Methodsmappend :: Lexical a -> Lexical a -> Lexical a Source #mconcat :: [Lexical a] -> Lexical a Source # Bits a => Monoid (BitSet a) Source # Instance detailsDefined in Data.BitSet Methodsmappend :: BitSet a -> BitSet a -> BitSet a Source #mconcat :: [BitSet a] -> BitSet a Source # Monoid b => Monoid (a -> b) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: a -> b Source #mappend :: (a -> b) -> (a -> b) -> a -> b Source #mconcat :: [a -> b] -> a -> b Source # Monoid (U1 p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmappend :: U1 p -> U1 p -> U1 p Source #mconcat :: [U1 p] -> U1 p Source # (Monoid a, Monoid b) => Monoid (a, b) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: (a, b) Source #mappend :: (a, b) -> (a, b) -> (a, b) Source #mconcat :: [(a, b)] -> (a, b) Source # Monoid (Proxy s) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodsmappend :: Proxy s -> Proxy s -> Proxy s Source #mconcat :: [Proxy s] -> Proxy s Source # (Applicative p, Semigroup a, Monoid a) => Monoid (Ap p a) Instance detailsDefined in Util Methodsmempty :: Ap p a Source #mappend :: Ap p a -> Ap p a -> Ap p a Source #mconcat :: [Ap p a] -> Ap p a Source # Monoid (f p) => Monoid (Rec1 f p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmempty :: Rec1 f p Source #mappend :: Rec1 f p -> Rec1 f p -> Rec1 f p Source #mconcat :: [Rec1 f p] -> Rec1 f p Source # (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: (a, b, c) Source #mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #mconcat :: [(a, b, c)] -> (a, b, c) Source # Monoid a => Monoid (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodsmempty :: Const a b Source #mappend :: Const a b -> Const a b -> Const a b Source #mconcat :: [Const a b] -> Const a b Source # (Applicative f, Monoid a) => Monoid (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodsmempty :: Ap f a Source #mappend :: Ap f a -> Ap f a -> Ap f a Source #mconcat :: [Ap f a] -> Ap f a Source # Alternative f => Monoid (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsmempty :: Alt f a Source #mappend :: Alt f a -> Alt f a -> Alt f a Source #mconcat :: [Alt f a] -> Alt f a Source # Monoid c => Monoid (K1 i c p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmempty :: K1 i c p Source #mappend :: K1 i c p -> K1 i c p -> K1 i c p Source #mconcat :: [K1 i c p] -> K1 i c p Source # (Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmempty :: (f :*: g) p Source #mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #mconcat :: [(f :*: g) p] -> (f :*: g) p Source # (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: (a, b, c, d) Source #mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #mconcat :: [(a, b, c, d)] -> (a, b, c, d) Source # Monoid (f p) => Monoid (M1 i c f p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmempty :: M1 i c f p Source #mappend :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #mconcat :: [M1 i c f p] -> M1 i c f p Source # Monoid (f (g p)) => Monoid ((f :.: g) p) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodsmempty :: (f :.: g) p Source #mappend :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #mconcat :: [(f :.: g) p] -> (f :.: g) p Source # (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmempty :: (a, b, c, d, e) Source #mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) Source # Monoid (k3 b a) => Monoid (Dual k3 a b) Instance detailsDefined in Control.Category.Dual Methodsmempty :: Dual k3 a b Source #mappend :: Dual k3 a b -> Dual k3 a b -> Dual k3 a b Source #mconcat :: [Dual k3 a b] -> Dual k3 a b Source #

class Monoid a => Group a where Source #

Methods

invert :: a -> a Source #

Instances
 Group () Source # Instance detailsDefined in Algebra Methodsinvert :: () -> () Source # Group a => Group (Identity a) Source # Instance detailsDefined in Algebra Methods Group a => Group (Dual a) Source # Instance detailsDefined in Algebra Methodsinvert :: Dual a -> Dual a Source # Num a => Group (Sum a) Source # Instance detailsDefined in Algebra Methodsinvert :: Sum a -> Sum a Source # Fractional a => Group (Product a) Source # Instance detailsDefined in Algebra Methodsinvert :: Product a -> Product a Source # Group a => Group (Lexical a) Source # Instance detailsDefined in Relation.Binary.Comparison Methodsinvert :: Lexical a -> Lexical a Source # Bits a => Group (BitSet a) Source # Instance detailsDefined in Data.BitSet Methodsinvert :: BitSet a -> BitSet a Source # Group b => Group (a -> b) Source # Instance detailsDefined in Algebra Methodsinvert :: (a -> b) -> a -> b Source # (Group a, Group b) => Group (a, b) Source # Instance detailsDefined in Algebra Methodsinvert :: (a, b) -> (a, b) Source # Group (Proxy a) Source # Instance detailsDefined in Algebra Methodsinvert :: Proxy a -> Proxy a Source # (Group a, Group b, Group c) => Group (a, b, c) Source # Instance detailsDefined in Algebra Methodsinvert :: (a, b, c) -> (a, b, c) Source # Group a => Group (Const a b) Source # Instance detailsDefined in Algebra Methodsinvert :: Const a b -> Const a b Source # (Group a, Group b, Group c, Group d) => Group (a, b, c, d) Source # Instance detailsDefined in Algebra Methodsinvert :: (a, b, c, d) -> (a, b, c, d) Source # (Group a, Group b, Group c, Group d, Group e) => Group (a, b, c, d, e) Source # Instance detailsDefined in Algebra Methodsinvert :: (a, b, c, d, e) -> (a, b, c, d, e) Source # Group (k3 b a) => Group (Dual k3 a b) Source # Instance detailsDefined in Algebra Methodsinvert :: Dual k3 a b -> Dual k3 a b Source #

class Semigroup a => Abelian a Source #

Instances
 Abelian () Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Abelian a => Abelian (Identity a) Source # Instance detailsDefined in Algebra Abelian a => Abelian (Dual a) Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra Bits a => Abelian (Min (BitSet a)) Source # Instance detailsDefined in Data.BitSet Bits a => Abelian (Max (BitSet a)) Source # Instance detailsDefined in Data.BitSet Bits a => Abelian (BitSet a) Source # Instance detailsDefined in Data.BitSet Abelian b => Abelian (a -> b) Source # Instance detailsDefined in Algebra (Abelian a, Abelian b) => Abelian (a, b) Source # Instance detailsDefined in Algebra Abelian (Proxy a) Source # Instance detailsDefined in Algebra (Abelian a, Abelian b, Abelian c) => Abelian (a, b, c) Source # Instance detailsDefined in Algebra Abelian a => Abelian (Const a b) Source # Instance detailsDefined in Algebra (Abelian a, Abelian b, Abelian c, Abelian d) => Abelian (a, b, c, d) Source # Instance detailsDefined in Algebra (Abelian a, Abelian b, Abelian c, Abelian d, Abelian e) => Abelian (a, b, c, d, e) Source # Instance detailsDefined in Algebra

class Semigroup a => Idempotent a Source #

Instances
 Source # Instance detailsDefined in Algebra Ord a => Idempotent (Min a) Source # Instance detailsDefined in Algebra Ord a => Idempotent (Max a) Source # Instance detailsDefined in Algebra Idempotent a => Idempotent (Identity a) Source # Instance detailsDefined in Algebra Idempotent a => Idempotent (Dual a) Source # Instance detailsDefined in Algebra Bits a => Idempotent (Min (BitSet a)) Source # Instance detailsDefined in Data.BitSet Bits a => Idempotent (Max (BitSet a)) Source # Instance detailsDefined in Data.BitSet Idempotent b => Idempotent (a -> b) Source # Instance detailsDefined in Algebra (Idempotent a, Idempotent b) => Idempotent (a, b) Source # Instance detailsDefined in Algebra Source # Instance detailsDefined in Algebra (Idempotent a, Idempotent b, Idempotent c) => Idempotent (a, b, c) Source # Instance detailsDefined in Algebra Idempotent a => Idempotent (Const a b) Source # Instance detailsDefined in Algebra (Idempotent a, Idempotent b, Idempotent c, Idempotent d) => Idempotent (a, b, c, d) Source # Instance detailsDefined in Algebra (Idempotent a, Idempotent b, Idempotent c, Idempotent d, Idempotent e) => Idempotent (a, b, c, d, e) Source # Instance detailsDefined in Algebra

(+) :: Semigroup (Sum a) => a -> a -> a infixl 6 Source #

(-) :: Group (Sum a) => a -> a -> a infixl 6 Source #

(*) :: Semigroup (Product a) => a -> a -> a infixl 7 Source #

(/) :: (Semigroup (Product a), Group (Product a)) => a -> a -> a infixl 7 Source #

(×) :: Semigroup (Product a) => a -> a -> a infixl 7 Source #

commuteWith :: Group b => (a -> a -> b) -> a -> a -> b Source #