MINIMAL XOR (Was: Proposal: Make Eq type class single method)
David Feuer
david.feuer at gmail.com
Wed Oct 27 15:19:45 UTC 2021
I think the only time they're not potentially contradictory is when you're
dealing with singletons, and that's a pretty special case.
On Wed, Oct 27, 2021, 11:15 AM Carter Schonwald <carter.schonwald at gmail.com>
wrote:
> not necessarily ... there could be contradictory sets of methods! :)
>
> like the minimal sets for Field type class, the xor would be for defining
> '/' in terms of reciprocal and times or vice versa (/ vs recip) and
> likewise (negate vs minus) etc etc
>
> On Wed, Oct 27, 2021 at 6:38 AM Henning Thielemann <
> lemming at henning-thielemann.de> wrote:
>
>>
>> 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?
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20211027/9f7f29e2/attachment.html>
More information about the Libraries
mailing list