Make Eq type class single method

Brandon Allbery allbery.b at gmail.com
Thu Oct 21 15:19:09 UTC 2021


Wasn't it already shown that ghc already swaps the order of branches to
match?

On Thu, Oct 21, 2021 at 11:13 AM David Feuer <david.feuer at gmail.com> wrote:

> Not relevant. One question i have though: in the case of primitive types,
> can switching from a primitive `/=` to one based on `==` change the order
> of branches and thereby affect performance for better or worse?
>
> On Thu, Oct 21, 2021, 10:19 AM Carter Schonwald <
> carter.schonwald at gmail.com> wrote:
>
>> So one thing I’d like to highlight, that I don’t know if we could bake
>> into ghc safely and might not be relevant here is:
>>
>> At least in some cases, implementations of EQ may use
>> “reallyUnsafePtrEquality#”, as a never false positive check that two heap
>> values are the same heap object. Naively this seems like it’s probably
>> orthogonal to the matter of Eq being a single or double method type class,
>> but I figure it’s worth asking out loud
>>
>> On Wed, Oct 20, 2021 at 4:29 PM Joachim Breitner <
>> mail at joachim-breitner.de> wrote:
>>
>>> Hi,
>>>
>>> parallel work… should have linked to
>>> https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6793
>>> earlier. But yes, it is rather simple to make that change.
>>>
>>> Am Mittwoch, dem 20.10.2021 um 19:49 +0300 schrieb Oleg Grenrus:
>>> > I attach the patches for ghc, containers and text.
>>> > I encourage someone (Joachim?) to run the nofib suite.
>>>
>>> nofib might be too specialized; I think “ghc compiling Cabal” is a good
>>> benchmark. I’ll do that eventually, if GHC’s CI doesn’t do that already
>>> for me (I’ll ask Ben what kind of infrastructure we have for that –
>>> doing it manually and correctly is tedious and error-prone), maybe
>>> tomorrow.
>>>
>>> Cheers,
>>> Joachim
>>> --
>>> Joachim Breitner
>>>   mail at joachim-breitner.de
>>>   http://www.joachim-breitner.de/
>>>
>>>
>>> _______________________________________________
>>> Libraries mailing list
>>> Libraries at haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20211021/bf441349/attachment.html>


More information about the Libraries mailing list