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, Subtractive a) => CommutativeRing a
- class (Distributive a, Divisive 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
Instances
class Distributive a => Semiring a Source #
A Semiring is a ring without, necessarily, negative elements.
FIXME: rule zero' = zero. Is this somehow expressible in haskell?
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 monoid under multiplication where multiplication distributes over addition. Alternatively, a ring is semiring where additive inverses exist
Instances
(Distributive a, Subtractive a) => Ring a Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class (Distributive a, Subtractive a) => CommutativeRing a Source #
A Commutative Ring is a ring with a Commutative Multiplication operation. Recall that Addition is Commutative in all Rings
Instances
(Distributive a, Subtractive a) => CommutativeRing a Source # | |
Defined in NumHask.Algebra.Abstract.Ring |
class (Distributive a, Divisive 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. FIXME: write a rule for this
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, Divisive a) => IntegralDomain (Wrapped a) Source # | |
Defined in NumHask.Data.Wrapped | |
(Additive a, Divisive 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
Instances
two :: (Multiplicative a, Additive a) => a Source #