plutus icon indicating copy to clipboard operation
plutus copied to clipboard

Add `deriveEq` or analog

Open uhbif19 opened this issue 3 years ago • 7 comments

Describe the feature you'd like

I saw deriveEq in examples and it was mentioned in issues, but I cannot find it in github or documentation. What happened to it?

Describe alternatives you've considered

Writing Eq instances by hand.

uhbif19 avatar Feb 09 '23 21:02 uhbif19

There was never a deriveEq in this repository. I think maybe someone else wrote one?

michaelpj avatar Feb 10 '23 10:02 michaelpj

But it is mentioned in your issue :thinking: https://github.com/input-output-hk/plutus/issues/4537

Maybe we mixed up and there was no such functionality.

Will adding deriveEq or its Generic equivalent considered a good PR for this repo?

uhbif19 avatar Feb 10 '23 13:02 uhbif19

It is mentioned in the example given by the issue creator, I assume they wrote one or got it from somewhere.

Will adding deriveEq or its Generic equivalent considered a good PR for this repo?

If it's not too much code then probably yes.

michaelpj avatar Feb 10 '23 13:02 michaelpj

Sorry, you right it probably was code from some closed repo.

uhbif19 avatar Feb 10 '23 13:02 uhbif19

@uhbif19 would you be interested in helping us out?

Maybe it's possible to simply adapt deriveEq without much change? It relies on buildTypeInstance, which accepts any ClassRep, which is where we probably can fit our own Eq analogously to how they do it here. No idea if it's actually going to work, though.

effectfully avatar Feb 15 '23 18:02 effectfully

@effectfully Yes, there is ~100LOC module with deriveEq function in https://github.com/Liqwid-Labs/plutus-extra, and I will try to make PR with it on this week.

uhbif19 avatar Feb 15 '23 19:02 uhbif19

Thank you very much!

effectfully avatar Feb 15 '23 20:02 effectfully