diff --git a/docs/Prelude.md b/docs/Prelude.md index 0d24cee3..bdb6aba0 100644 --- a/docs/Prelude.md +++ b/docs/Prelude.md @@ -1027,6 +1027,12 @@ sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`). Instances should satisfy the following laws in addition to the `Ord` laws: +- Supremum: + - `a || b >= a` + - `a || b >= b` +- Infimum: + - `a && b <= a` + - `a && b <= b` - Associativity: - `a || (b || c) = (a || b) || c` - `a && (b && c) = (a && b) && c` diff --git a/src/Prelude.purs b/src/Prelude.purs index 8b73f4ad..74a71984 100644 --- a/src/Prelude.purs +++ b/src/Prelude.purs @@ -904,6 +904,12 @@ instance boundedOrdering :: Bounded Ordering where -- | Instances should satisfy the following laws in addition to the `Ord` -- | laws: -- | +-- | - Supremum: +-- | - `a || b >= a` +-- | - `a || b >= b` +-- | - Infimum: +-- | - `a && b <= a` +-- | - `a && b <= b` -- | - Associativity: -- | - `a || (b || c) = (a || b) || c` -- | - `a && (b && c) = (a && b) && c`