The Equatable
and Hashable
protocols in Swift seem simple enough, but they have
certain laws that must be upheld when implementing conformances. Learn about the notions
of “equivalence relation” and “well-definedness” in order to understand why they are
so important, and dive deep into what makes a correct (and incorrect) conformance to
these protocols.