HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulesemirings-0.7Haskell98

Data.Ring.Ordered

An 'ordered ring' is a ring with a total order.

Mathematical pedantry note

Many (if not most) of the instances of the OrderedRing type class are not truly ordered rings in the mathematical sense, as the axioms imply that the underlying set is either a singleton or infinite. Thus, the additional properties of ordered rings do not, in general, hold.

We indicate those instances that are 'truly' or 'mathematically' ordered rings in their documentation.

  • 1 type
  • 1 class
  • Packagesemirings-0.7
  • Exports2
  • LanguageHaskell98
  • LicenceBSD-3-Clause
  • SourceOrdered.hs

Helper types

1 declaration
newtypenewtype Modular a
#

A wrapper to indicate the type is being treated as a modular arithmetic system whose modulus is the type's cardinality.

While we cannot guarantee that infinite types won't be wrapped by this, we only provide instances of the relevant type classes for those types we are certain are finite.

Constructors

Instances23Bounded, Eq, Data, Ord, Read, Show, …

Ordered ring type class

1 declaration
classclass (Ring a, Ord a) => OrderedRing a where
#

The class of rings which also have a total order.

Instance should satisfy the following laws:

Methods

  • abs :: a -> a

    Compute the absolute value.

  • signum :: a -> a

    Determine the 'sign' of a value.

Instances18OrderedRing, …