Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Describes a ring and operations on its members.
- https://en.wikipedia.org/wiki/Ring_%28mathematics%29.
- https://www.numericana.com/answer/rings.htm.
Synopsis
- class Ring r where
- (=+=) :: r -> r -> r
- (=*=) :: r -> r -> r
- additiveInverse :: r -> r
- multiplicativeIdentity :: r
- additiveIdentity :: r
- (=-=) :: r -> r -> r
- square :: r -> r
- product' :: Ring r => BisectionRatio -> MinLength -> [r] -> r
- sum' :: Ring r => BisectionRatio -> MinLength -> [r] -> r
- (=^) :: (Eq r, Integral power, Ring r, Show power) => r -> power -> r
Type-classes
- Define both the operations applicable to all members of the ring, and its mandatory members.
- Minimal definition;
=+=
,=*=
,additiveInverse
,multiplicativeIdentity
,additiveIdentity
.
:: r | |
-> r | |
-> r | Addition of two members; required to be commutative; https://en.wikipedia.org/wiki/Commutativity. |
:: r | |
-> r | |
-> r | Multiplication of two members. |
:: r | |
-> r | The operand required to yield zero under addition; https://en.wikipedia.org/wiki/Additive_inverse. |
multiplicativeIdentity Source #
:: r | The identity-member under multiplication; https://mathworld.wolfram.com/MultiplicativeIdentity.html. |
:: r | The identity-member under addition (AKA zero); https://en.wikipedia.org/wiki/Additive_identity. |
:: r | |
-> r | |
-> r | Subtract the two specified ring-members. |
:: r | |
-> r | Square the ring. |
Instances
Types
Data-types
Functions
product' :: Ring r => BisectionRatio -> MinLength -> [r] -> r Source #
Returns the product of the list of ring-members.
sum' :: Ring r => BisectionRatio -> MinLength -> [r] -> r Source #
Returns the sum of the list of ring-members.
Operators
(=^) :: (Eq r, Integral power, Ring r, Show power) => r -> power -> r infixr 8 Source #
- Raise a ring-member to the specified positive integral power.
- Exponentiation is implemented as a sequence of either squares of, or multiplications by, the ring-member; https://en.wikipedia.org/wiki/Exponentiation_by_squaring.