title: Scala: How to override tuple equals() method for arbitrary element types?
body: <p>I have a map with values keyed by tuple. In my case I need tuples match irrespective of elements order so, for example, I need this to hold:</p>
  
  <pre><code>(1, 2) == (2, 1) is true
  </code></pre>
  
  <p>How to override tuple <code>equals</code> operator, so for any types X, Y :</p>
  
  <pre><code>(a:X, b:Y) == (b:Y, a:X) is true  ?   
  </code></pre>
  
  <p><em>Corrected later</em>: Another idea would be to write my own <code>Pair</code> class with required behavior. How <code>equals()</code> override will look like in this case?</p>