One of the relationships implied by the Ord typeclass is:

a <= b = True  iff  compare a b = EQ \/ compare a b = LT

If we write an alternative definition of (<=) that is only strict in its first argument:

False <= _ = True
True <= x = x

Then it's impossible to write `compare` in a way that's consistent with that relation.

More concretely, it's likely that Ord Bool is defined via `compare`, which is necessarily strict in both arguments.

On Wed, 2 Jan. 2019, 7:47 pm V.Liepelt, <V.Liepelt@kent.ac.uk> wrote:
I am surprised to find that `False <= undefined = undefined`.

What justifies (<=) to be strict in both arguments?

Vilem
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.