Zulip Chat Archive

Stream: general

Topic: Equality for Except


Jonathan Reicher (Apr 30 2025 at 06:43):

Is there a reason why the Except type doesn't have an instance for DecidableEq/BEq? It seems so trivial to me!

I just had to implement it myself for some code I am writing

Robin Arnez (Apr 30 2025 at 06:56):

Huh, well I guess Sum is an alternative

Robin Arnez (Apr 30 2025 at 06:57):

But the instance should probably exist

Jonathan Reicher (Apr 30 2025 at 07:11):

Right? I guess nobody needed it before :sweat_smile:
I would make a PR, but I'm not sure how to write the DecidableEq instance, and I have never done a PR before for an open source project

Jonathan Reicher (Apr 30 2025 at 10:18):

Unfotunently, of course, you can't use deriving for this because of the generic types

In general, if deriving delarations would work with generic types, like they do in rust it would be very convienent

Aaron Liu (Apr 30 2025 at 10:21):

Wait really?

Jonathan Reicher (Apr 30 2025 at 10:22):

Yeah I was shocked too, there is no instance
I tried the docs, tried inferInstance and tried loogle and no BEq and no DecidableEq

Aaron Liu (Apr 30 2025 at 10:23):

This works fine for me on the web server

deriving instance DecidableEq for Except

Aaron Liu (Apr 30 2025 at 10:23):

without any imports at all (except I guess import Init by default)

Eric Wieser (Apr 30 2025 at 14:08):

We should probably have the instance, but it's not obvious to me why you'd actually want to use it


Last updated: May 02 2025 at 03:31 UTC