| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
NumHask.Algebra.Ring
Description
Ring classes. A distinguishment is made between Rings and Commutative Rings.
- class (MultiplicativeAssociative a, MultiplicativeUnital a, Distribution a) => Semiring a
- class (Semiring a, AdditiveGroup a) => Ring a
- class (Multiplicative a, Ring a) => CRing a
- class Semiring a => StarSemiring a where
- class (StarSemiring a, AdditiveIdempotent a) => KleeneAlgebra a
- class Semiring a => InvolutiveRing a where
Documentation
class (MultiplicativeAssociative a, MultiplicativeUnital a, Distribution a) => Semiring a Source #
Semiring
Instances
| Semiring Bool Source # | |
| Semiring Double Source # | |
| Semiring Float Source # | |
| Semiring Int Source # | |
| Semiring Int8 Source # | |
| Semiring Int16 Source # | |
| Semiring Int32 Source # | |
| Semiring Int64 Source # | |
| Semiring Integer Source # | |
| Semiring Natural Source # | |
| Semiring Word Source # | |
| Semiring Word8 Source # | |
| Semiring Word16 Source # | |
| Semiring Word32 Source # | |
| Semiring Word64 Source # | |
| (AdditiveGroup a, Semiring a) => Semiring (Complex a) Source # | |
| (Ord a, Signed a, Integral a, AdditiveInvertible a) => Semiring (Ratio a) Source # | |
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
Instances
| Ring Double Source # | |
| Ring Float Source # | |
| Ring Int Source # | |
| Ring Int8 Source # | |
| Ring Int16 Source # | |
| Ring Int32 Source # | |
| Ring Int64 Source # | |
| Ring Integer Source # | |
| Ring Word Source # | |
| Ring Word8 Source # | |
| Ring Word16 Source # | |
| Ring Word32 Source # | |
| Ring Word64 Source # | |
| Ring a => Ring (Complex a) Source # | |
| (Ord a, Signed a, Integral a, AdditiveGroup a) => Ring (Ratio a) Source # | |
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.
Instances
| CRing Double Source # | |
| CRing Float Source # | |
| CRing Int Source # | |
| CRing Int8 Source # | |
| CRing Int16 Source # | |
| CRing Int32 Source # | |
| CRing Int64 Source # | |
| CRing Integer Source # | |
| CRing Word Source # | |
| CRing Word8 Source # | |
| CRing Word16 Source # | |
| CRing Word32 Source # | |
| CRing Word64 Source # | |
| CRing a => CRing (Complex a) Source # | |
| (Ord a, Signed a, Integral a, Multiplicative a, Ring a) => CRing (Ratio a) Source # | |
class Semiring a => StarSemiring a where Source #
StarSemiring
star a = one + a `times` star a
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".
Instances