numhask-0.5.0: numeric classes

Safe HaskellSafe
LanguageHaskell2010

NumHask.Algebra.Abstract.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 magma b ∈ T

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

Methods

magma :: a -> a -> a Source #

Instances
Magma a => Magma (Wrapped a) Source # 
Instance details

Defined in NumHask.Data.Wrapped

Methods

magma :: Wrapped a -> Wrapped a -> Wrapped a Source #

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

Defined in NumHask.Algebra.Abstract.Group

Methods

magma :: (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 magma a = a
a magma unit = a

Methods

unit :: a Source #

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

Defined in NumHask.Algebra.Abstract.Group

Methods

unit :: a -> b Source #

class Magma a => Associative a Source #

An Associative Magma

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

Defined in NumHask.Algebra.Abstract.Group

class Magma a => Commutative a Source #

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

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

Defined in NumHask.Algebra.Abstract.Group

class Magma a => Absorbing a where Source #

An Absorbing is a Magma with an Absorbing Element

a `times` absorb = absorb

Methods

absorb :: a Source #

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

Defined in NumHask.Algebra.Abstract.Group

Methods

absorb :: a -> b Source #

class Magma a => Invertible a where Source #

An Invertible Magma

∀ a,b ∈ T: inv a `magma` (a `magma` b) = b = (b `magma` a) `magma` inv a

Methods

inv :: a -> a Source #

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

Defined in NumHask.Algebra.Abstract.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 magma a = a
Instances
Magma a => Idempotent (Wrapped a) Source # 
Instance details

Defined in NumHask.Data.Wrapped

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

Defined in NumHask.Algebra.Abstract.Group

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

A Group is a Associative, Unital and Invertible Magma.

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

Defined in NumHask.Algebra.Abstract.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
(Associative a, Unital a, Invertible a, Commutative a) => AbelianGroup a Source # 
Instance details

Defined in NumHask.Algebra.Abstract.Group