Skip to content

Commit ac720e4

Browse files
Extend comment to Ord noting that Number is not fully law abiding (#277)
* Extend comment to Ord noting that Number is not fully law abiding * Update CHANGELOG for #277
1 parent ac7352a commit ac720e4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Other improvements:
1414
- Changed `unit`'s FFI representation from `{}` to `undefined` (#267 by @JordanMartinez)
1515
- Added clearer docs for Prelude module (#270 by @JordanMartinez)
1616
- Clarify docs for `flip` (#271 by @JordanMartinez)
17+
- Add comment that `Number` is not a fully law abiding instance of `Ord` (#277 by @JamieBallingall)
1718

1819
## [v5.0.1](https://github.com/purescript/purescript-prelude/releases/tag/v5.0.1) - 2021-05-11
1920

src/Data/Ord.purs

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import Type.Proxy (Proxy(..), Proxy2, Proxy3)
3434
-- | - Reflexivity: `a <= a`
3535
-- | - Antisymmetry: if `a <= b` and `b <= a` then `a = b`
3636
-- | - Transitivity: if `a <= b` and `b <= c` then `a <= c`
37+
-- |
38+
-- | **Note:** The `Number` type is not an entirely law abiding member of this
39+
-- | class due to the presence of `NaN`, since `NaN <= NaN` evaluates to `false`
3740
class Eq a <= Ord a where
3841
compare :: a -> a -> Ordering
3942

0 commit comments

Comments
 (0)