title: Haskell Remove duplicates from list
body: <p>I am new to Haskell and I am trying the below code to remove duplicates from a list. However it does not seem to work. </p>
  
  <pre><code>compress []     = []
  compress (x:xs) = x : (compress $ dropWhile (== x) xs)
  </code></pre>
  
  <p>I have tried some search, all the suggestions use foldr/ map.head. Is there any implementation with basic constructs?</p>