Document unlawful Num in Data.Fixed
Summary
In https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Fixed.html#t:Fixed
The Num instance should have a warning that it is unlawful.
It doesn't satisfy the multiplicative associativity law:
Prelude Data.Fixed> 0.1 * (0.1 * 10) :: Fixed E1
0.1
Prelude Data.Fixed> (0.1 * 0.1) * 10 :: Fixed E1
0.0
And it also doesn't satisfy distributivity:
Prelude Data.Fixed> 0.1 * (0.5 + 0.5) :: Fixed E1
0.1
Prelude Data.Fixed> 0.1 * 0.5 + 0.1 * 0.5 :: Fixed E1
0.0
I also see that the documentation for Float and Double doesn't mention these violations:
*Main> 0.1 * 1e-45 * 10 :: Float
0.0
*Main> 0.1 * (1e-45 * 10) :: Float
1.0e-45
*Main> 0.1 * (5e-45 + 5e-45) :: Float
1.0e-45
*Main> 0.1 * 5e-45 + 0.1 * 5e-45 :: Float
0.0