Module

# Data.Bounded

Package
purescript-prelude
Repository
purescript/purescript-prelude

### #BoundedSource

``class (Ord a) <= Bounded a  where``

The `Bounded` type class represents totally ordered types that have an upper and lower boundary.

Instances should satisfy the following law in addition to the `Ord` laws:

• Bounded: `bottom <= a <= top`

#### Members

• `top :: a`
• `bottom :: a`

#### Instances

• `Bounded Boolean`
• `Bounded Int`

The `Bounded` `Int` instance has `top :: Int` equal to 2^31 - 1, and `bottom :: Int` equal to -2^31, since these are the largest and smallest integers representable by twos-complement 32-bit integers, respectively.

• `Bounded Char`

Characters fall within the Unicode range.

• `Bounded Ordering`
• `Bounded Unit`
• `Bounded Number`

## Re-exports from Data.Ord

### #OrderingSource

``data Ordering``

The `Ordering` data type represents the three possible outcomes of comparing two values:

`LT` - The first value is less than the second. `GT` - The first value is greater than the second. `EQ` - The first value is equal to the second.

• `LT`
• `GT`
• `EQ`

#### Instances

• `Eq Ordering`
• `Semigroup Ordering`
• `Show Ordering`

### #OrdSource

``class (Eq a) <= Ord a  where``

The `Ord` type class represents types which support comparisons with a total order.

`Ord` instances should satisfy the laws of total orderings:

• Reflexivity: `a <= a`
• Antisymmetry: if `a <= b` and `b <= a` then `a = b`
• Transitivity: if `a <= b` and `b <= c` then `a <= c`

#### Members

• `compare :: a -> a -> Ordering`

#### Instances

• `Ord Boolean`
• `Ord Int`
• `Ord Number`
• `Ord String`
• `Ord Char`
• `Ord Unit`
• `Ord Void`
• `(Ord a) => Ord (Array a)`
• `Ord Ordering`
• `(RowToList row list, OrdRecord list row) => Ord (Record row)`

### #(>=)Source

Operator alias for Data.Ord.greaterThanOrEq (left-associative / precedence 4)

### #(>)Source

Operator alias for Data.Ord.greaterThan (left-associative / precedence 4)

### #(<=)Source

Operator alias for Data.Ord.lessThanOrEq (left-associative / precedence 4)

### #(<)Source

Operator alias for Data.Ord.lessThan (left-associative / precedence 4)