Skip to content

Commit bfe859a

Browse files
committed
Export BoundedOrd
1 parent b7a6c29 commit bfe859a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/Prelude.md

+20
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,26 @@ The lack of explicit `Ord` constraint allows flexibility in the use of
822822
`Bounded` so it can apply to total and partially ordered sets, boolean
823823
algebras, etc.
824824

825+
#### `BoundedOrd`
826+
827+
``` purescript
828+
class (Bounded a, Ord a) <= BoundedOrd a
829+
```
830+
831+
##### Instances
832+
``` purescript
833+
instance boundedOrdBoolean :: BoundedOrd Boolean
834+
instance boundedOrdUnit :: BoundedOrd Unit
835+
instance boundedOrdOrdering :: BoundedOrd Ordering
836+
instance boundedOrdInt :: BoundedOrd Int
837+
```
838+
839+
The `BoundedOrd` type class represents totally ordered finite data types.
840+
841+
Instances should satisfy the following law in addition to the `Ord` laws:
842+
843+
- Ordering: `bottom <= a <= top`
844+
825845
#### `BooleanAlgebra`
826846

827847
``` purescript

src/Prelude.purs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Prelude
2121
, Eq, eq, (==), (/=)
2222
, Ordering(..), Ord, compare, (<), (>), (<=), (>=)
2323
, Bounded, top, bottom
24+
, BoundedOrd
2425
, BooleanAlgebra, conj, disj, not, (&&), (||)
2526
, Show, show
2627
) where

0 commit comments

Comments
 (0)