title: F# If Statement List.exists
body: <p>This is a School Assignment but everything i am about to post is done by me and me only. Therefore I only require your help for a tiny step in my assignment at which i am stuck. </p>
  
  <pre><code>let rec removeDuplicates2 xs =
    match xs with
    |[]-&gt;[]
    |y::ys -&gt; if y = (List.exists y ys) then
                (removeDuplicates2 ys)
              else
                y::(removeDuplicates2 ys)
  
  printfn "%A" (removeDuplicates2 [3;1;3;2;1]) // result must be [3;1;2] 
  </code></pre>
  
  <p>What i require help for is making the if statement that checks if element y is a member of list ys</p>
  
  <p>at the moment i get the error saying: "This expression was expected to have type
      ''a -> bool'
  but here has type
      'bool'"</p>
  
  <p>can someone tell me what i am doing wrong? </p>