@@ -17,6 +17,7 @@ instance numUnit :: Num Unit
1717instance eqUnit :: Eq Unit
1818instance ordUnit :: Ord Unit
1919instance boundedUnit :: Bounded Unit
20+ instance boundedOrdUnit :: BoundedOrd Unit
2021instance booleanAlgebraUnit :: BooleanAlgebra Unit
2122instance showUnit :: Show Unit
2223```
@@ -713,6 +714,7 @@ instance semigroupOrdering :: Semigroup Ordering
713714instance eqOrdering :: Eq Ordering
714715instance ordOrdering :: Ord Ordering
715716instance boundedOrdering :: Bounded Ordering
717+ instance boundedOrdOrdering :: BoundedOrd Ordering
716718instance showOrdering :: Show Ordering
717719```
718720
@@ -785,7 +787,7 @@ Test whether one value is _non-strictly greater than_ another.
785787#### ` Bounded `
786788
787789``` purescript
788- class (Ord a) <= Bounded a where
790+ class Bounded a where
789791 top :: a
790792 bottom :: a
791793```
@@ -796,14 +798,18 @@ instance boundedBoolean :: Bounded Boolean
796798instance boundedUnit :: Bounded Unit
797799instance boundedOrdering :: Bounded Ordering
798800instance boundedInt :: Bounded Int
801+ instance boundedFn :: (Bounded b) => Bounded (a -> b)
799802```
800803
801- The ` Bounded ` type class represents types that are finite partially
802- ordered sets.
804+ The ` Bounded ` type class represents types that are finite.
803805
804- Instances should satisfy the following law in addition to the ` Ord ` laws:
806+ Although there are no "internal" laws for ` Bounded ` , every value of ` a `
807+ should be considered less than or equal to ` top ` by some means, and greater
808+ than or equal to ` bottom ` .
805809
806- - Ordering: ` bottom <= a <= top `
810+ The lack of explicit ` Ord ` constraint allows flexibility in the use of
811+ ` Bounded ` so it can apply to total and partially ordered sets, boolean
812+ algebras, etc.
807813
808814#### ` BooleanAlgebra `
809815
@@ -818,6 +824,7 @@ class (Bounded a) <= BooleanAlgebra a where
818824``` purescript
819825instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
820826instance booleanAlgebraUnit :: BooleanAlgebra Unit
827+ instance booleanAlgebraFn :: (BooleanAlgebra b) => BooleanAlgebra (a -> b)
821828```
822829
823830The ` BooleanAlgebra ` type class represents types that behave like boolean
0 commit comments