groups-0.4.0.0: Haskell 98 groups

Safe HaskellSafe
LanguageHaskell98

Data.Group

Synopsis

Documentation

class Monoid m => Group m where Source

A Group is a Monoid plus a function, invert, such that:

a <> invert a == mempty
invert a <> a == mempty

Minimal complete definition

invert

Methods

invert :: m -> m Source

pow :: Integral x => m -> x -> m Source

pow a n == a <> a <> ... <> a
 (n lots of a)

If n is negative, the result is inverted.

Instances

Group () Source 
Group a => Group (Dual a) Source 
Num a => Group (Sum a) Source 
Fractional a => Group (Product a) Source 
Group b => Group (a -> b) Source 
(Group a, Group b) => Group (a, b) Source 
(Group a, Group b, Group c) => Group (a, b, c) Source 
(Group a, Group b, Group c, Group d) => Group (a, b, c, d) Source 
(Group a, Group b, Group c, Group d, Group e) => Group (a, b, c, d, e) Source 

class Group g => Abelian g Source

An Abelian group is a Group that follows the rule:

a <> b == b <> a

Instances

Abelian () Source 
Abelian a => Abelian (Dual a) Source 
Num a => Abelian (Sum a) Source 
Fractional a => Abelian (Product a) Source 
Abelian b => Abelian (a -> b) Source 
(Abelian a, Abelian b) => Abelian (a, b) Source 
(Abelian a, Abelian b, Abelian c) => Abelian (a, b, c) Source 
(Abelian a, Abelian b, Abelian c, Abelian d) => Abelian (a, b, c, d) Source 
(Abelian a, Abelian b, Abelian c, Abelian d, Abelian e) => Abelian (a, b, c, d, e) Source