How to define `:(==)` on user-defined types for `Set` operations

That second topic — Create a user-type set — is exactly your situation. The mutability is irrelevant here. When you re-define ==, you must also symmetrically redefine hash.

2 Likes