title: intersection of sets in F#
body: <p>In an attempt to understand one of the answers from <a href="https://stackoverflow.com/questions/13561301/intersection-between-two-lists-f">this question</a>. I edited the code to look like this however it only returns <code>[]</code></p>
  
  <pre><code>let rec intersect a b =
      let L1 = List.sort(a)
      let L2 = List.sort(b)
      match L1 with
      |h::t -&gt; match L2 with
               |h2::t2 -&gt; 
                   if h=h2 then h::(intersect t t2)
                   else if h&gt;h2 then intersect t L2 else intersect L1 t2
               |[] -&gt; []
      |[] -&gt; [];;
  
  intersect [1;2;3] [2;3;4]
  </code></pre>
  
  <p>What do I need to change to make it return a list (set) of intersecting values?</p>