title: Nested tuple extractor in scala ->
body: <p>Is there a convenient extractor that is the reflection (in mathematical sense) of the <code>-&gt;</code> operator?</p>
  
  <p>For example, this works:</p>
  
  <pre><code>scala&gt; val y = 1 -&gt; 2 -&gt; 3
  y: ((Int, Int), Int) = ((1,2),3)
  
  scala&gt; y match { case ((a,b),c) =&gt; s"Values are : $a, $b, and $c" }
  res0: String = Values are : 1, 2, and 3
  </code></pre>
  
  <p>But this doesn't:</p>
  
  <pre><code>scala&gt; y match { case a -&gt; b -&gt; c =&gt; s"Values are : $a, $b, and $c" }
  &lt;console&gt;:9: error: not found: value -&gt;
                y match { case a -&gt; b -&gt; c =&gt; s"Values are : $a, $b, and $c" }
                                      ^
  &lt;console&gt;:9: error: not found: value a
                y match { case a -&gt; b -&gt; c =&gt; s"Values are : $a, $b, and $c" }
                                                              ^
  </code></pre>
  
  <p>You can see how this would be useful when you have a number of nested tuples. In case you're wondering, my nested tuples are produced by an external library, so I can't just 'flatten' y myself.</p>