how come ~= and == means the same thing
They are not the same, but are similar in many cases.
== is an equality operator, used mainly by
Equatable protocol. While
~= is a pattern matching operator, and is picked up by just about any pattern matching control flow,
if case, etc.