title: Delete all instances from list
body: <p>I'm trying to delete all instances of an item in a list using haskell. I get an error that I don't really understand. Can anyone help me out and let me know if I'm doing the correct thing?</p>
  
  <pre><code>deleteAllInstances :: (a, [l]) =&gt;  a -&gt; [l] -&gt; [l]
  deleteAllInstances (a, []) = []
  deleteAllInstances (i, (x:xs))
      | i == x = tail
      | otherwise = x ++ tail
      where tail = deleteAllInstances i xs
  </code></pre>