title: How do I access a list element I've added with the cons (:) operator?
body: <p>I'm new to <b>Haskell</b> (and functional programming in general) and was wondering how I can access a new element that I've added to a list using the <b>cons</b> (:) operator?</p>
  
  <p>For example, using <b>WinGHCi</b> I create a new list and access the first element:</p>
  
  <pre><code>ghci&gt; let a = [1,2,3]
  ghci&gt; a!!0
  1
  </code></pre>
  
  <p>The prompt returns 1, the value of the first element, cool. Now I append a new value to the front of the list and try to access it:</p>
  
  <pre><code>ghci&gt; 5:a
  [5,1,2,3]
  ghci&gt; a!!0
  1
  </code></pre>
  
  <p>It looks like the list items don't get re-indexed. I tried getting a negative index to work and other such things but the compiler didn't seem to approve. The tutorials I'm reading just skip over it and I couldn't find anything of use online. How do I get the value "5" from the list?</p>
  
  <p>Thanks for the help and sorry if this is a very basic question.</p>