[Haskell-cafe] Unnecessarily strict implementations

Henning Thielemann lemming at henning-thielemann.de
Thu Sep 2 12:25:11 EDT 2010


On Thu, 2 Sep 2010, Stephen Sinclair wrote:

> On Thu, Sep 2, 2010 at 3:25 AM, Jan Christiansen
> <jac at informatik.uni-kiel.de> wrote:
>> I prefer
>>
>>  False <= _|_ = True
>
> Sorry to go a bit off topic, but I find it funny that I never really
> noticed you could perform less-than or greater-than comparisons on
> Bool values.  What's the semantic reasoning behind allowing relative
> comparisons on booleans?  In what context would you use it?

You might use or abuse (<=) for implication, however the arrow points to 
the wrong direction.

>  It seems to me a throwback to C's somewhat arbitrary assumption that False=0
> and True=1.

My feeling is similar.

The Ord instance for Bool might be justified for using Bools as keys of 
Data.Map, however you can also consider using Ord for Map as abuse.


More information about the Haskell-Cafe mailing list