title: Removing duplicated from sorted list (OCaml)
body: <p>I'm trying to remove duplicate items from already sorted list in OCaml. This is my code:</p>
  
  <pre><code>let rec remove_dup = function
      | [] -&gt; []
      | hd :: [] -&gt; hd :: []
      | hd :: hd2 :: tl -&gt; if (hd == hd2) (remove_dup tl) :: hd else (remove_dup (h2 :: tl) :: hd;;
  </code></pre>
  
  <p>I'm getting a syntax error.</p>