title: Count the occurrence of an element in a list- OCaml
body: <p>How would I go about counting the occurrence of a particular element in a list in Ocaml? </p>
  
  <pre><code>count 2 [1;2;2;2;2;3;4;5] # should return 4
  </code></pre>
  
  <p>I am having trouble figuring out how fold works and how I would apply it here. I tried doing:</p>
  
  <pre><code>count element list = fold (fun f ele head -&gt; if ele = head then 1 else 0) 0 list
  </code></pre>
  
  <p>But this keeps returning 0 for my tests?</p>