Module

Data.Group

#Group

class (Monoid g) <= Group g  where

A Group is a Monoid with inverses. Instances must satisfy the following law in addition to the monoid laws:

  • Inverse: forall x. ginverse x <> x = mempty = x <> ginverse x

Members

Instances

#Abelian

type Abelian a b = Group a => Commutative a => b

An Abelian group is a group with a commutative operation.

#power

power :: forall g. Group g => g -> Int -> g

Append a value (or its inverse) to itself a certain number of times.

For the Additive Int type, this is the same as multiplication.

Modules