# PureScript numeric hierarchy overview

## Semiring

definition
set with commutative addition monoid and multiplication monoid (not necessarily commutative), with distributivity of multiplication over addition
provides
zero, one, add (+), mul (*)
examples
Natural numbers, $$\mathbb{N}$$
Boolean semiring $$(1 + 1 = 1)$$

## Ring

definition
semiring where addition forms a group, not just a monoid
provides
sub (-)
examples
Square matrices, e.g. $$\mathrm{Mat}(2,\mathbb{R})$$
Linear mappings $$V \to V$$ for some vector space $$V$$

## Commutative Ring

definition
ring where multiplication is commutative
provides
(no extra methods)
examples
Integers modulo $$m$$, where $$m \in \mathbb{N}$$

## Division Ring

definition
ring where every non-zero element has a multiplicative inverse
provides
recip
examples
Quaternions, $$\mathbb{H}$$

## Euclidean Ring

definition
non-zero commutative ring with no zero-divisors, equipped with a euclidean function
provides
div (/), mod, degree
examples
Integers, $$\mathbb{Z}$$
Polynomials, $$\mathbb{R}[x]$$

## Field

definition
commutative ring in which every non-zero element has a multiplicative inverse
provides
(no extra methods)
examples
Reals, $$\mathbb{R}$$
Rationals, $$\mathbb{Q}$$
Complex numbers, $$\mathbb{C}$$
Integers modulo $$p$$, where $$p$$ is prime