
2 Jan
2019
2 Jan
'19
6:37 a.m.
On Wed, Jan 02, 2019 at 09:47:15AM +0000, V.Liepelt wrote:
I am surprised to find that `False <= undefined = undefined`.
What justifies (<=) to be strict in both arguments?
The implementation of the Ord instance for Bool is derived, as you can see here: https://www.stackage.org/haddock/lts-12.1/ghc-prim-0.5.2.0/src/GHC-Classes.h... As for the justification, perhaps it's too much of a special case for only one value of an enumeration to compare to undefined without crashing, and perhaps it inhibits optimisation opportunities. Tom