Add fixity for (==) and (/=)

Eric Mertens emertens at
Tue Sep 18 15:58:18 UTC 2018

> On Sep 18, 2018, at 8:45 AM, Dannyu NDos <ndospark320 at> wrote:
> Well, the motivation to make them associative was that (==) is logical XNOR, and (/=) is logical XOR. Perhaps we want an alias for Bool-instantization of them.

We already have such an binary operation in base that is associative: xor.

>>> import Data.Bits
>>> :i xor
class Eq a => Bits a where
  xor :: a -> a -> a
  	-- Defined in ‘Data.Bits’
>>> True `xor` False `xor` True

The thing that would be missing is an xnor operation in Data.Bits.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list