title: ocaml recursive pattern matching
body: <p>I'm trying to write a simple recursive function that look over list and return a pair of integer. This is easy to write in c/c++/java but i'm new to ocaml so somehow hard to find out the solution due to type conflict </p>
  
  <p>it should goes like ..</p>
  
  <pre><code>let rec test p l = ... ;;
  val separate : (’a -&gt; bool) -&gt; ’a list -&gt; int * int = &lt;fun&gt;
  test (fun x -&gt; x mod 2 = 0) [-3; 5; 2; -6];; 
  - : int * int = (2, 2)
  </code></pre>
  
  <p>so the problem is how can i recursively return value on tuple ..</p>