How to check two `Array` instances for identity equality in constant time?

I am, like Jordan himself, rather unenthusiastic about it.

A quick test for non-equality is indeed quite useful sometimes! However, I do not think implementing it generally requires "insider access" like implementing isIdentical(to:) does -- a negative test would generally be based on information that is already exposed through the type's public API surface. This makes such tests nonessential -- people who need them can easily define them on their own.

Even worse, people will most definitely disagree on how much data needs to get compared, and in what order -- there is no One Correct Implementation of isDefinitelyNotEqual; its definition varies with context.

On top of it all, there is also no obvious name for such a thing.

1 Like