Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ring
Synopsis
- class (Additive a, Multiplicative a) => Distributive a
- class Distributive a => Semiring a
- class (Distributive a, Subtractive a) => Ring a
- class Distributive a => IntegralDomain a
- class Distributive a => StarSemiring a where
- class (StarSemiring a, Idempotent a) => KleeneAlgebra a
- class Distributive a => InvolutiveRing a where
- adj :: a -> a
- two :: (Multiplicative a, Additive a) => a
Documentation
class (Additive a, Multiplicative a) => Distributive a Source #
Distributive laws
a * (b + c) == a * b + a * c (a * b) * c == a * c + b * c zero * a == zero a * zero == zero
The sneaking in of the annihilation laws here glosses over the possibility that the multiplicative zero element does not have to correspond with the additive unital zero.
Instances
class Distributive a => Semiring a Source #
A Semiring is commutative monoidal under addition, has a monoidal multiplication operator (not necessarily commutative), and where multiplication distributes over addition.
Instances
Distributive a => Semiring a Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class (Distributive a, Subtractive a) => Ring a Source #
A Ring is an abelian group under addition and monoidal under multiplication, and where multiplication distributes over addition.
Instances
(Distributive a, Subtractive a) => Ring a Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class Distributive a => IntegralDomain a Source #
An Integral Domain generalizes a ring of integers by requiring the product of any two nonzero elements to be nonzero. This means that if a ≠ 0, an equality ab = ac implies b = c.
Instances
IntegralDomain Double Source # | |
Defined in NumHask.Algebra.Abstract.Ring | |
IntegralDomain Float Source # | |
Defined in NumHask.Algebra.Abstract.Ring | |
(IntegralDomain a, Subtractive a) => IntegralDomain (Complex a) Source # | |
Defined in NumHask.Data.Complex | |
GCDConstraints a => IntegralDomain (Ratio a) Source # | |
Defined in NumHask.Data.Rational | |
IntegralDomain a => IntegralDomain (Pair a) Source # | |
Defined in NumHask.Data.Pair | |
(Ord a, ExpField a, LowerBoundedField a) => IntegralDomain (LogField a) Source # | |
Defined in NumHask.Data.LogField | |
(Additive a, Multiplicative a) => IntegralDomain (Wrapped a) Source # | |
Defined in NumHask.Data.Wrapped | |
(Additive a, Multiplicative a) => IntegralDomain (Positive a) Source # | |
Defined in NumHask.Data.Positive | |
IntegralDomain b => IntegralDomain (a -> b) Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class Distributive a => StarSemiring a where Source #
A StarSemiring is a semiring with an additional unary operator star satisfying:
star a = one + a `times` star a
Nothing
Instances
StarSemiring a => StarSemiring (Wrapped a) Source # | |
StarSemiring b => StarSemiring (a -> b) Source # | |
class (StarSemiring a, Idempotent a) => KleeneAlgebra a Source #
A Kleene Algebra is a Star Semiring with idempotent addition
a `times` x + x = a ==> star a `times` x + x = x x `times` a + x = a ==> x `times` star a + x = x
Instances
(StarSemiring a, Magma a) => KleeneAlgebra (Wrapped a) Source # | |
Defined in NumHask.Data.Wrapped | |
KleeneAlgebra b => KleeneAlgebra (a -> b) Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class Distributive 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".
Nothing