title: Pattern matching for lambda expressions
body: <pre><code> 21 --Primitive recursion constructor
   22 pr :: ([Int] -&gt; Int) -&gt; ([Int] -&gt; Int) -&gt; ([Int] -&gt; Int)
   23 pr f g = \xs 0 -&gt; f xs
   24 pr f g = \xs (y+1) -&gt; g xs y ((pr f g) xs y)
  </code></pre>
  <p>I want the function this function creates to act differently on different inputs, so that it can create a recursive function. As expected, the above code doesn't work.  How do I do something like pattern matching, but for the function it creates?</p>