title: OCaml type mismatch during compilation
body: <p>Look at my code:</p>
  
  <pre><code>let my lst p q =
    if lst = [] then
      []
    else
      let i = 0 in let res = [] in let acc=[] in
      fold_left ( fun acc h -&gt; 
        if (not (p h) &amp;&amp; not(q h)) then
      ((i+1), [], res)
        else if (p h &amp;&amp; not (q h)) then
      ((i+1), (i::acc),res)
        else if (not (p h) &amp;&amp;  q h) then
      ((i+1), [] (acc@res))
        else
      ((i+1), [], ((i::acc)@res))) 
       (i,acc,res) lst;;
  </code></pre>
  
  <p>And I got error of compilation:</p>
  
  <blockquote>
    <p>This expression has type int * int list * 'a list
           but an expression was expected of type int list</p>
  </blockquote>
  
  <p>Can You help me ?</p>