diff --git a/CHANGELOG.md b/CHANGELOG.md index c17fed84..c5e19e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Other improvements: - Changed `unit`'s FFI representation from `{}` to `undefined` (#267 by @JordanMartinez) - Added clearer docs for Prelude module (#270 by @JordanMartinez) - Clarify docs for `flip` (#271 by @JordanMartinez) +- Add comment that `Number` is not a fully law abiding instance of `Ord` (#277 by @JamieBallingall) ## [v5.0.1](https://github.com/purescript/purescript-prelude/releases/tag/v5.0.1) - 2021-05-11 diff --git a/src/Data/Ord.purs b/src/Data/Ord.purs index 795e9af3..c2c60ace 100644 --- a/src/Data/Ord.purs +++ b/src/Data/Ord.purs @@ -34,6 +34,9 @@ import Type.Proxy (Proxy(..), Proxy2, Proxy3) -- | - Reflexivity: `a <= a` -- | - Antisymmetry: if `a <= b` and `b <= a` then `a = b` -- | - Transitivity: if `a <= b` and `b <= c` then `a <= c` +-- | +-- | **Note:** The `Number` type is not an entirely law abiding member of this +-- | class due to the presence of `NaN`, since `NaN <= NaN` evaluates to `false` class Eq a <= Ord a where compare :: a -> a -> Ordering