[Haskell-cafe] A question about GHC test coverage
Olaf Klinke
olf at aatal-apotheke.de
Tue Feb 14 21:35:37 UTC 2017
You should not have to write tests for functions you did not define. Correct me if I'm wrong, but any property of max can be derived from the properties of <=. Sadly, the laws for Ord are not stated in the documentation of Data.Ord. (Because there is no consensus?) They are:
Reflexive:
if x == y then x <= y
Transitive:
if x <= y and y <= z then x <= z
Antisymmetric:
if x <= y and y <= x then x == y
Olaf
More information about the Haskell-Cafe
mailing list