<p>Is there an equivalent operator to Haskell's list difference operator <code>\\</code> in F#?</p>

[{'answer_id': 59814, 'author': 'nlucaroni', 'author_id': 157, 'author_profile': 'https://Stackoverflow.com/users/157', 'pm_score': 3, 'selected': False, 'text': '<p>Nope... Just write it and make it an infix operator --using the set of special characters. Backslash (<code>\\</code>) is not in the list below, so it will not work as an infix operator. See the <a href="http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc207785578" rel="nofollow noreferrer">manual</a>:</p>\n\n<blockquote>\n  <p>infix-op :=</p>\n\n<pre><code>or || &amp; &amp;&amp; &lt;OP &gt;OP $OP = |OP &amp;OP ^OP :: -OP +OP *OP /OP %OP\n\n**OP\n</code></pre>\n  \n  <p>prefix-op :=</p>\n\n<pre><code>!OP ?OP ~OP -OP +OP % %% &amp; &amp;&amp;\n</code></pre>\n</blockquote>\n'}, {'answer_id': 827771, 'author': 'J D', 'author_id': 13924, 'author_profile': 'https://Stackoverflow.com/users/13924', 'pm_score': -1, 'selected': False, 'text': '<p>Assuming you really want conventional set difference rather than the weird ordered-but-unsorted multiset subtraction that Haskell apparently provides, just convert the lists to sets using the built-in <code>set</code> function and then use the built-in <code>-</code> operator to compute the set difference:</p>\n\n<pre><code>set xs - set ys\n</code></pre>\n\n<p>For example:</p>\n\n<pre><code>&gt; set [1..5] - set [2..4];;\nval it : Set&lt;int&gt; = seq [1; 5]\n</code></pre>\n'}, {'answer_id': 6085288, 'author': 'Hans', 'author_id': 472522, 'author_profile': 'https://Stackoverflow.com/users/472522', 'pm_score': 2, 'selected': False, 'text': '<p>Filter items from the set of the subtrahend:</p>\n\n<pre><code>let ( /-/ ) xs ys =\n    let ySet = set ys\n    let notInYSet x = not &lt;| Set.contains x ySet\n    List.filter notInYSet xs\n</code></pre>\n'}, {'answer_id': 12435807, 'author': 'Ramon Snir', 'author_id': 327201, 'author_profile': 'https://Stackoverflow.com/users/327201', 'pm_score': 4, 'selected': True, 'text': "<p>Was bounced, yet I believe it is worth to write here the implementation of <code>( /-/ )</code> (the F# version of Haskell's <code>\\\\</code>):</p>\n\n<pre><code>let flip f x y = f y x\n\nlet rec delete x = function\n  | [] -&gt; []\n  | h :: t when x = h -&gt; t\n  | h :: t -&gt; h :: delete x t\n\nlet inline ( /-/ ) xs ys = List.fold (flip delete) xs ys\n</code></pre>\n\n<p>This will operate as Haskell's <code>\\\\</code>, so that <code>(xs @ ys) /-/ xs = ys</code>. For example: <code>(7 :: [1 .. 5] @ [5 .. 11]) /-/ [4 .. 7]</code> evaluates into <code>[1; 2; 3; 5; 7; 8; 9; 10; 11]</code>.</p>\n"}, {'answer_id': 27955212, 'author': 'Lay González', 'author_id': 1120410, 'author_profile': 'https://Stackoverflow.com/users/1120410', 'pm_score': 1, 'selected': False, 'text': "<p>I'm using this:</p>\n\n<pre><code>let (/-/) l1 l2 = List.filter (fun i -&gt; not &lt;| List.exists ((=) i) l2) l1\n</code></pre>\n\n<p>If anyone sees a problem, let me know.</p>\n\n<p>Is for lists, so there could be duplicates in the result. For example:</p>\n\n<pre><code>[1;1;2] /-/ [2;3] would be eq to [1;1]\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/59711', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4592/']