groups-0.4.1.0: Haskell 98 groups

Safe Haskell | Safe
Language | Haskell98

Data.Group

Synopsis

- class Monoid m => Group m where
- class Group g => Abelian g

# 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 # |
Methods invert :: () -> () Source # pow :: Integral x => () -> x -> () Source #
Group a => Group (Dual a) Source # |
Methods invert :: Dual a -> Dual a Source # pow :: Integral x => Dual a -> x -> Dual a Source #
Num a => Group (Sum a) Source # |
Methods invert :: Sum a -> Sum a Source # pow :: Integral x => Sum a -> x -> Sum a Source #
Fractional a => Group (Product a) Source # |
Methods invert :: Product a -> Product a Source # pow :: Integral x => Product a -> x -> Product a Source #
Group b => Group (a -> b) Source # |
Methods invert :: (a -> b) -> a -> b Source # pow :: Integral x => (a -> b) -> x -> a -> b Source #
(Group a, Group b) => Group (a, b) Source # |
Methods invert :: (a, b) -> (a, b) Source # pow :: Integral x => (a, b) -> x -> (a, b) Source #
(Group a, Group b, Group c) => Group (a, b, c) Source # |
Methods invert :: (a, b, c) -> (a, b, c) Source # pow :: Integral x => (a, b, c) -> x -> (a, b, c) Source #
(Group a, Group b, Group c, Group d) => Group (a, b, c, d) Source # |
Methods invert :: (a, b, c, d) -> (a, b, c, d) Source # pow :: Integral x => (a, b, c, d) -> x -> (a, b, c, d) Source #
(Group a, Group b, Group c, Group d, Group e) => Group (a, b, c, d, e) Source # |
Methods invert :: (a, b, c, d, e) -> (a, b, c, d, e) Source # pow :: Integral x => (a, b, c, d, e) -> x -> (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 # |