title: F# adding an element to a list if it doesn't exists
body: <p>I'm starting to learn f# from scratch, and i'm finding myself quite confused with the difference between arrays and lists, I know lists are immutable but still.</p>
  
  <p>I'm trying to create a function that adds an element to a list if it doesn't exists and return the new list, otherwise if it exists return the current list.</p>
  
  <p>Here is what i have so far:</p>
  
  <pre><code>let elem x= Array.exists ((=) x)
  let elemOrAdd e l = if elem e l then l else e::l
  </code></pre>
  
  <p>the e::l doesn't work, visual studio throws</p>
  
  <pre><code>This expression was expected to have type
      'a []    
  but here has type
      'b list
  </code></pre>
  
  <p>I already find it a bit fishy that i have to use that Array.exists, but i truly am at a loss.</p>
  
  <p>Any hints about what i'm doing wrong?</p>