# std.cmp

Functionality for ordering and comparison.

## Types

#### `type Eq a = { (==) : a -> a -> Bool }`

`Eq a` defines equality (==) on `a`

#### ```type Bool = | False | True```

`Bool` represents a value which can only be `True` or `False`

#### `type Ord a = { eq : Eq a, compare : a -> a -> Ordering }`

`Ord a` defines an ordering on `a`

#### ```type Ordering = | LT | EQ | GT```

`Ordering` represents the result of comparing two values

## Values

#### `let == ?eq : forall a . [Eq a] -> a -> a -> Bool`

Tests whether the values are equal.

#### `let /= ?eq l r : forall a . [Eq a] -> a -> a -> Bool`

Tests whether the values are not equal.

#### `let compare ?ord : forall a . [Ord a] -> a -> a -> Ordering`

Compares two values and returns wheter the first is less than, equal or greater than the second.

#### `let < l r : forall a . [Ord a] -> a -> a -> Bool`

Returns whether `l` is less than `r`.

#### `let <= l r : forall a . [Ord a] -> a -> a -> Bool`

Returns whether `l` is less than or equal to `r`.

#### `let >= l r : forall a . [Ord a] -> a -> a -> Bool`

Returns whether `l` is greater than or equal to `r`.

#### `let > l r : forall a . [Ord a] -> a -> a -> Bool`

Returns whether `l` is greater than `r`.

#### `let semigroup : Semigroup Ordering`

`Semigroup a` represents an associative operation on `a`. This means the following laws must hold:

• `forall x . append x (append y z) == append (append x y) z`

#### `let monoid : Monoid Ordering`

`Monoid a` represents an semigroup an which has an identity. This means the following additional laws must hold:

• `forall x . append x empty == x`
• `forall x . append empty x == x`