numhask-0.8.1.0: A numeric class hierarchy.
Safe HaskellSafe-Inferred
LanguageHaskell2010

NumHask.Algebra.Group

Description

The Group hierarchy

Synopsis

Documentation

class Magma a where Source #

A Magma is a tuple (T,magma) consisting of

  • a type a, and
  • a function (magma) :: T -> T -> T

The mathematical laws for a magma are:

  • magma is defined for all possible pairs of type T, and
  • magma is closed in the set of all possible values of type T

or, more tersly,

∀ a, b ∈ T: a ⊕ b ∈ T

These laws are true by construction in haskell: the type signature of and the above mathematical laws are synonyms.

Methods

(⊕) :: a -> a -> a infix 3 Source #

Instances

Instances details
Magma b => Magma (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

Methods

(⊕) :: (a -> b) -> (a -> b) -> a -> b Source #

class Magma a => Unital a where Source #

A Unital Magma is a magma with an identity element (the unit).

unit ⊕ a = a
a ⊕ unit = a

Methods

unit :: a Source #

Instances

Instances details
Unital b => Unital (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

Methods

unit :: a -> b Source #

class Magma a => Associative a Source #

An Associative Magma

(a ⊕ b) ⊕ c = a ⊕ (b ⊕ c)

Instances

Instances details
Associative b => Associative (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

class Magma a => Commutative a Source #

A Commutative Magma is a Magma where the binary operation is commutative.

a ⊕ b = b ⊕ a

Instances

Instances details
Commutative b => Commutative (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

class Magma a => Absorbing a where Source #

An Absorbing is a Magma with an Absorbing Element

a ⊕ absorb = absorb

Methods

absorb :: a Source #

Instances

Instances details
Absorbing b => Absorbing (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

Methods

absorb :: a -> b Source #

class Magma a => Invertible a where Source #

An Invertible Magma

∀ a,b ∈ T: inv a ⊕ (a ⊕ b) = b = (b ⊕ a) ⊕ inv a

Methods

inv :: a -> a Source #

Instances

Instances details
Invertible b => Invertible (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

Methods

inv :: (a -> b) -> a -> b Source #

class Magma a => Idempotent a Source #

An Idempotent Magma is a magma where every element is Idempotent.

a ⊕ a = a

Instances

Instances details
Idempotent b => Idempotent (a -> b) Source # 
Instance details

Defined in NumHask.Algebra.Group

class (Associative a, Unital a, Invertible a) => Group a Source #

A Group is a Associative, Unital and Invertible Magma.

Instances

Instances details
(Associative a, Unital a, Invertible a) => Group a Source # 
Instance details

Defined in NumHask.Algebra.Group

class (Associative a, Unital a, Invertible a, Commutative a) => AbelianGroup a Source #

An Abelian Group is an Associative, Unital, Invertible and Commutative Magma . In other words, it is a Commutative Group

Instances

Instances details
(Associative a, Unital a, Invertible a, Commutative a) => AbelianGroup a Source # 
Instance details

Defined in NumHask.Algebra.Group