Skip to content

Commit 8cb9e1f

Browse files
committed
Merge pull request #13 from hdgarrood/lattice-laws
Add more lattice laws
2 parents 1dcdd5c + 5f9fe76 commit 8cb9e1f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/Prelude.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,12 @@ sets with a supremum (`sup` or `||`) and infimum (`inf` or `&&`).
10271027
Instances should satisfy the following laws in addition to the `Ord`
10281028
laws:
10291029

1030+
- Supremum:
1031+
- `a || b >= a`
1032+
- `a || b >= b`
1033+
- Infimum:
1034+
- `a && b <= a`
1035+
- `a && b <= b`
10301036
- Associativity:
10311037
- `a || (b || c) = (a || b) || c`
10321038
- `a && (b && c) = (a && b) && c`

src/Prelude.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,12 @@ instance boundedOrdering :: Bounded Ordering where
904904
-- | Instances should satisfy the following laws in addition to the `Ord`
905905
-- | laws:
906906
-- |
907+
-- | - Supremum:
908+
-- | - `a || b >= a`
909+
-- | - `a || b >= b`
910+
-- | - Infimum:
911+
-- | - `a && b <= a`
912+
-- | - `a && b <= b`
907913
-- | - Associativity:
908914
-- | - `a || (b || c) = (a || b) || c`
909915
-- | - `a && (b && c) = (a && b) && c`

0 commit comments

Comments
 (0)