MINIMAL XOR (Was: Proposal: Make Eq type class single method)

Henning Thielemann lemming at henning-thielemann.de
Wed Oct 27 10:38:47 UTC 2021


On Mon, 25 Oct 2021, Carter Schonwald wrote:

> i agree with Tom and Hecate,more strongly: 
>  https://github.com/ghc/ghc/blob/98aa29d3fe447cce3407e6864b015892244bb475/libraries/ghc-prim/GHC/Classes.hs#L142-L150 
> the current definition DOES NOT require defining both. 
> 
> as it currently stands, you only need to define one of '==' XOR  '/='
> 
> this actually suggests an interesting and DIFFERENT ecosystem improvement, (ignoring IEEE non-signalling NANs),
> namely we add support for XOR to minimal pragma syntax and issue a warning 
> 
> perhaps something like adding (XOR "reason String" clauseExpr1 clauseexpr2) ?

The problem of implementing two methods in a contradictory way arises for 
any OR in MINIMAL pragma, right?


More information about the Libraries mailing list