spire
spire copied to clipboard
Determine === and =!= strategy
Let's group here a bunch of stuff:
#294 Support Eq in tests in a shouldEqv matcher (let's have a look) #601 BaseSyntaxTest uses .equals #599 No hashCode for Number #619 Remove === and =!= methods (PR) #423 Add === method for all data types (!) #405 Drop cooperative eq. or test it? #444 Add cooperative equality tests #508 More principled approach to equality #611 Quaternion and Complex use cooperative equality
After discussion with @non:
- We keep cooperative equality/hashCode for compatibility with collections and the OO world in general.
- In parallel, we provide
Eq
andHash
instances. - This defines two parallel "worlds" under composition. We have to test that the definitions match using laws.
- Data types should not have
===
and=!=
methods as those are special. Adding methods for other operators is fine. For that, revisit @rklaehn work. - When the
Eq
typeclass calls a method on the type, call the methodinternal_eq
or something similar. - These rules should go in the style guide.
It appears the only remaining tracked issue here is the ===
and =!=
strategy.