Optimizing Eq instances with reallyUnsafePtrEquality#

Simon Jakobi via Haskell-Cafe <[email protected]>
Newsgroups gmane.comp.lang.haskell.cafe,gmane.comp.lang.haskell.libraries
Message-ID <CAGtp2Si5U7YoA2AR=Q9aeRJ6P+eeFjpTtfqa-wuooN_pGBYXig@mail.gmail.com>
Hi everyone!

In https://github.com/haskell-unordered-containers/unordered-containers/issues/77
we're wondering whether certain Eq instances, for example record types
or strings, could be optimized by including a pointer equality check
that detects when an object is compared with itself.

Does anyone here have experience with such an optimization? Has this
been considered before, for example in GHC's deriving machinery?

One complication seems to be the correct handling of fields with
irreflexive instances, for example Float and Double. In such a case,
pointer equality doesn't imply "==-equality".

I'm looking forward to hearing your thoughts on this! :)

Cheers,
Simon
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.