Proposal: Data.Bool.implies

Joachim Breitner mail at joachim-breitner.de
Mon Jan 18 15:43:53 UTC 2016


Hi,

Am Montag, den 18.01.2016, 03:17 +0100 schrieb Niklas Hambüchen:
> I propose to add to Data.Bool:
> 
>     -- | Boolean implication.
>     implies :: Bool -> Bool -> Bool
>     implies True  x = x
>     implies False _ = True
> 
>     infix 4 `implies` -- same as (==)

I’m +1 on the grounds that although I know that one of <= or => cuts
it, it causes extra mental work to find out which (and annoyance to
find out that it is the “wrong” one). Using a name is explicit and gets
it right the first time.

-1 on changing the order for Bool, it would just break too much code
that relies on that in a fairly obscure way.

+1 for making it right-associative, as implications are usually
written.

Undecided about ==>. It would be nice, but the conflict with quickcheck
would be annoying. Leaning towards -1.


Greetings,
Joachim
-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160118/2eb931cc/attachment.sig>


More information about the Libraries mailing list