numhask-0.2.2.0: numeric classes

Safe HaskellNone
LanguageHaskell2010

NumHask.Algebra.Ring

Description

Ring classes. A distinguishment is made between Rings and Commutative Rings.

Synopsis

Documentation

class (Semiring a, AdditiveGroup a) => Ring a Source #

Ring

A Ring consists of a set equipped with two binary operations that generalize the arithmetic operations of addition and multiplication; it is an abelian group with a second binary operation that is associative, is distributive over the abelian group operation, and has an identity element.

Summary of the laws inherited from the ring super-classes:

zero + a == a
a + zero == a
(a + b) + c == a + (b + c)
a + b == b + a
a - a = zero
negate a = zero - a
negate a + a = zero
a + negate a = zero
one `times` a == a
a `times` one == a
(a `times` b) `times` c == a `times` (b `times` c)
a `times` (b + c) == a `times` b + a `times` c
(a + b) `times` c == a `times` c + b `times` c
a `times` zero == zero
zero `times` a == zero

class (Multiplicative a, Ring a) => CRing a Source #

CRing is a Ring with Multiplicative Commutation. It arises often due to * being defined as a multiplicative commutative operation.

class Semiring a => StarSemiring a where Source #

StarSemiring

star a = one + a `times` star a

Methods

star :: a -> a Source #

plus' :: a -> a Source #

class (StarSemiring a, AdditiveIdempotent a) => KleeneAlgebra a Source #

KleeneAlgebra

a `times` x + x = a ==> star a `times` x + x = x
x `times` a + x = a ==> x `times` star a + x = x

class Semiring a => InvolutiveRing a where Source #

Involutive Ring

adj (a + b) ==> adj a + adj b
adj (a * b) ==> adj a * adj b
adj one ==> one
adj (adj a) ==> a

Note: elements for which adj a == a are called "self-adjoint".

Methods

adj :: a -> a Source #