title: How to convert one partial function to another?
body: <p>Suppose I've got partial function <code>parf</code></p>
  
  <pre><code>val parf: PartialFunction[Int, String] = { case 0 =&gt; "!!!" }
  </code></pre>
  
  <p>Now I've got also <code>case class A(x: Int)</code> and I need a function to transform <code>PartialFunction[Int, String]</code> to <code>PartialFunction[A, String]</code>:</p>
  
  <pre><code>def foo(pf: PartialFunction[Int, String]): PartialFunction[A, String] = ???
  </code></pre>
  
  <p>For example, <code>foo(parf)</code> should return <code>{case A(0) =&gt; "!!!" }</code>. How would you write function <code>foo</code> ? </p>