title: Is there a cleaner way to pattern-match in Scala anonymous functions?
body: <p>I find myself writing code like the following:</p>
  
  <pre><code>val b = a map (entry =&gt;
      entry match {
          case ((x,y), u) =&gt; ((y,x), u)
      }
  )
  </code></pre>
  
  <p>I would like to write it differently, if only this worked:</p>
  
  <pre><code>val c = a map (((x,y) -&gt; u) =&gt;
      (y,x) -&gt; u
  )
  </code></pre>
  
  <p>Is there any way I can get something close to this?</p>