Proposal: Data.Bool.implies

Herbert Valerio Riedel hvriedel at gmail.com
Mon Jan 18 09:14:12 UTC 2016


On 2016-01-18 at 03:17:44 +0100, Niklas Hambüchen wrote:

[...]

> The request for this is quite old (see e.g.
> http://neilmitchell.blogspot.de/2007/02/logical-implication-in-haskell.html).
>
> I believe that by not trying to use an operator for it, and keeping it
> in Data.Bool, we can avoid doing anything wrong.

Just wondering, what could/would go wrong if we did use an operator
`==>` (still be hidden in Data.Bool[1]), i.e.

 (==>) :: Bool -> Bool -> Bool
 True  ==> x  = x
 False ==> _  = True


this would leave open the option to have an obvious flipped version

  (<==) :: Bool -> Bool -> Bool
  (<==) = flip (==>)



 [1]: Consequently, if `==>` is available only via explicit Data.Bool
      import, a conflict with QuickCheck's (==>) shouldn't be a big
      issue IMHO


More information about the Libraries mailing list