title: selecting the tail of a list of tuples in haskell
body: <p>I have the following code:</p>
  
  <pre><code>type DecV = [(Var,Aexp)]
  
  d_v_ds :: DecV -&gt; (EnvV, Store) -&gt; (EnvV, Store)
  d_v_ds [] (envV, sto) = (envV, sto)
  d_v_ds [(v, xAexp)] (envV, sto) = do
                  d_v_ds (tail ([(v, xAexp)])) (envV', sto')
  </code></pre>
  
  <p>when I try to run this I get a non-exhastive pattern error. I have tried changing the function to:</p>
  
  <pre><code>d_v_ds :: DecV -&gt; (EnvV, Store) -&gt; (EnvV, Store)
  d_v_ds [] (envV, sto) = (envV, sto)
  d_v_ds [(v, xAexp): a] (envV, sto) = do
                      d_v_ds (a) (envV', sto')
  </code></pre>
  
  <p>the function wont compile. How can I do this?
  thank you</p>