title: Haskell shift list
body: <p>I want to shift a list by n elements to the left. Why do I get an error if I want to change the order from <code>(x:xs)</code> to <code>(xs:x)</code>?</p>
  
  <pre><code>shift n list@(x:xs)
      | n == 0 = list
      | otherwise = shift (n-1) (xs:x) -- (xs:x) error
  </code></pre>
  
  <blockquote>
    <p>Occurs check: cannot construct the infinite type: a ~ [a]</p>
  </blockquote>
  
  <p>I don't know how to interpret this error. Maybe someone of you can help me.
  Thank you very much.</p>
  
  <blockquote>
    <p><strong>EDIT: As it was already mentioned, the correct term to use is rotate and not shift</strong></p>
  </blockquote>