rings-0.0.2.4: Groups, rings, semirings, and dioids.

Safe HaskellSafe
LanguageHaskell2010

Data.Ring

Synopsis

Documentation

(<<) :: Group g => g -> g -> g infixl 6 Source #

(><) :: Semiring r => r -> r -> r infixr 7 Source #

Multiplicative operation.

(<>) :: Semigroup a => a -> a -> a infixr 6 #

An associative operation.

negate :: Group g => g -> g Source #

class (Group r, Semiring r) => Ring r where Source #

Rings.

A ring R is a commutative group with a second monoidal operation >< that distributes over <>.

The basic properties of a ring follow immediately from the axioms:

 r >< memptymemptymempty >< r
 negate sunit >< r ≡ negate r

Furthermore, the binomial formula holds for any commuting pair of elements (that is, any a and b such that a >= b< a).

If mempty = sunit in a ring R, then R has only one element, and is called the zero ring. Otherwise the additive identity, the additive inverse of each element, and the multiplicative identity are unique.

See https://en.wikipedia.org/wiki/Ring_(mathematics).

If the ring is ordered (i.e. has an Ord instance), then the following additional properties must hold:

 a b == a <> c b < c
 mempty a && mempty <= b == mempty a< b

See the properties module for a detailed specification of the laws.

Minimal complete definition

fromInteger

Methods

fromInteger :: Integer -> r Source #

A ring homomorphism from the integers to r.

abs :: Ord r => r -> r Source #

Absolute value of an element.

 abs r ≡ r >< signum r

signum :: Ord r => r -> r Source #

Instances
Ring Int Source # 
Instance details

Defined in Data.Int.Instance

Ring Int8 Source # 
Instance details

Defined in Data.Int.Instance

Ring Int16 Source # 
Instance details

Defined in Data.Int.Instance

Ring Int32 Source # 
Instance details

Defined in Data.Int.Instance

Ring Int64 Source # 
Instance details

Defined in Data.Int.Instance

Ring Integer Source # 
Instance details

Defined in Data.Int.Instance

Ring Uni Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Deci Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Centi Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Milli Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Micro Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Nano Source # 
Instance details

Defined in Data.Fixed.Instance

Ring Pico Source # 
Instance details

Defined in Data.Fixed.Instance

Ring a => Ring (Complex a) Source # 
Instance details

Defined in Data.Complex.Instance