title: How can I use PartialFunctions to compose my match statements?
body: <p>Consider the following:</p>
  
  <pre><code>scala&gt; object Currency extends Enumeration {
       |   type Currency = Value
       |   val USD = Value
       |   val GBP = Value
       |   val EUR = Value
       |   val TRY = Value // Turkish lira
       |   val NGN = Value // Nigerian naira
       | }
  defined module Currency
  
  scala&gt; import Currency._
  import Currency._
  
  scala&gt; val pf: (String) =&gt; Option[Currency] = {
       |     case "$" =&gt; Some(USD)
       |     case "€" =&gt; Some(EUR)
       |     case "£" =&gt; Some(GBP)
       |     case "₦" =&gt; Some(NGN)
       |     case _ =&gt; None
       |   }
  pf: (String) =&gt; Option[Currency.Currency] = &lt;function1&gt;
  </code></pre>
  
  <p>I thought I'd be able to then do this:</p>
  
  <pre><code>scala&gt; "$" match pf
  &lt;console&gt;:1: error: '{' expected but identifier found.
         "$" match pf
                   ^
  </code></pre>
  
  <p>But no. Am I missing something basic here? My hope was that my PartialFunction could be used and reused in match statements. Is this not possible?</p>