Similarity of enums with associated values

If you have read this previous post you have seen how to compare two enums with associated values for equality. The equality included the associated values as well which is only fair. But sometimes you are not interested in the associated values but only want to know, if the two enums are of the same case regardless of the possibly associated values; I call this in the following if they are „similar“.

Weiterlesen