File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ import Data.Void (Void)
1010-- | - Reflexivity: `x == x = true`
1111-- | - Symmetry: `x == y = y == x`
1212-- | - Transitivity: if `x == y` and `y == z` then `x == z`
13+ -- |
14+ -- | **Note:** The `Number` type is not an entirely law abiding member of this
15+ -- | class due to the presence of `NaN`, since `NaN /= NaN`. Additionally,
16+ -- | computing with `Number` can result in a loss of precision, so sometimes
17+ -- | values that should be equivalent are not.
1318class Eq a where
1419 eq :: a -> a -> Boolean
1520
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ import Data.Unit (Unit, unit)
1717-- | - Multiplication distributes over addition:
1818-- | - Left distributivity: `a * (b + c) = (a * b) + (a * c)`
1919-- | - Right distributivity: `(a + b) * c = (a * c) + (b * c)`
20- -- | - Annihiliation: `zero * a = a * zero = zero`
20+ -- | - Annihilation: `zero * a = a * zero = zero`
21+ -- |
22+ -- | **Note:** The `Number` and `Int` types are not fully law abiding
23+ -- | members of this class hierarchy due to the potential for arithmetic
24+ -- | overflows, and in the case of `Number`, the presence of `NaN` and
25+ -- | `Infinity` values. The behaviour is unspecified in these cases.
2126class Semiring a where
2227 add :: a -> a -> a
2328 zero :: a
You can’t perform that action at this time.
0 commit comments