I agree that dynamic equality checking is something that would be useful to support.
We don't need to introduce a protocol though. It's possible to implement an API that takes two values of type Any
, returning true
when both values are of the same type and that type implements Equatable
or false
otherwise. The implementation requires some black magic but users don't need to worry about that.