Proposal: Data.Bool.implies

Niklas Hambüchen mail at nh2.me
Mon Jan 18 13:45:26 UTC 2016


On 18/01/16 05:12, David Feuer wrote:
> -1. We already have a `<=` operator.

I would actively discourage from using that for implication - it is
extremely counter-intuitive, and invites future headlines like

  "Self Driving Car Crushes Human Because In Haskell Logical Operators
Are The Other Way Around"

On 18/01/16 06:23, Jon Purdy wrote:
> +1. “<=” has the wrong strictness. In “a `implies` b”, “b” should not be
> evaluated if “a” is false.
>
> As a strawman, I’d propose that the Ord instance for Bool be changed—but
> this is more likely to break existing code, however slightly.

I think there's simply a difference between comparison and implication.
For `<=` the existing strictness makes sense. For implication, a
different strictness makes sense.


More information about the Libraries mailing list