title: Pattern matching on multiple values at the same time
body: <p>In Kotlin, we can use <code>when</code> to pattern match on a given value, e.g., </p>
  
  <pre><code>when(value) {
      1 -&gt; "One"
      2, 3 -&gt; "Two or three"
      else -&gt; "The rest"
  }
  </code></pre>
  
  <p>We can also pattern match on multiple values at the same time by nesting the two values in a <code>Pair</code>.</p>
  
  <pre><code>when(Pair(value1, value2)) {
      (1, "One") -&gt; "One"
      (2, "Two"), (3, "Three") -&gt; "Two or three"
      else -&gt; "The rest"
  }
  </code></pre>
  
  <p><strong>Are there better ways of pattern matching on two values at the same time than nesting the two values in a pair?</strong> </p>