Open kl0tl opened 3 years ago
Yes, we should add it for completeness.
However, now that we have polykinds, is it possible for Equals
to become polymorphic, so that we don't need an Ordering.Equals
or Symbol.Equals
?
I don’t think we can have a single polymorphic Equals
class: its instance for symbols would overlap the other instances for orderings and booleans!
Also since Boolean
has only two inhabitants we can have more functional dependencies (lhs out -> rhs
and rhs out -> lhs
), allowing the compiler to deduce one of the parameters from the other and the result (which isn’t possible for symbols nor orderings when the result is False
).
Ah, good point.
We have
Type.Data.Ordering.Equals
andType.Data.Symbol.Equals
but noType.Data.Boolean.Equals
.Is there any reason for not wanting or needing this class?
I assume it would be implemented like this: