title: Scala: how to destructure a basic map entry
body: <p>Here is a  vanilla scala map:</p>
  
  <pre><code>scala&gt; val m = Map( 'a'-&gt; '1', 'b' -&gt; 2)
  m: scala.collection.immutable.Map[Char,AnyVal] = Map(a -&gt; 1, b -&gt; 2)
  </code></pre>
  
  <p>The Map iterator() method returns a tuple representing the (key,value). So if we want to see, say, just the values of the map we can do this:</p>
  
  <pre><code>scala&gt; m.map( a =&gt; a._2)
  res0: scala.collection.immutable.Iterable[AnyVal] = List(1, 2)
  </code></pre>
  
  <p>But how do we destructure the map entry ? The following does not work:</p>
  
  <pre><code>scala&gt; m.map( (a,b) =&gt;  b)
  &lt;console&gt;:10: error: wrong number of parameters; expected = 1
                m.map( (a,b) =&gt;  b)
                         ^
  </code></pre>