title: Couldn't match expected type `[([Char], a0)]' with actual type `([Char], t0)' Haskell
body: <p>I am starting to program with haskell. The program I am developing just sums the total of a list with two elementes, for example:</p>
  
  <pre><code>[("book",10),("cookies",2),("icecream",5)]
  </code></pre>
  
  <p>This should return "17". Here i my code:</p>
  
  <pre><code>total [] = []
  total ([("c",e)]:y) = total y ++ [e]
  </code></pre>
  
  <p>But while running in GHCi it gives me this error:</p>
  
  <pre><code>&lt;interactive&gt;:80:8:
      Couldn't match expected type `[([Char], a0)]'
                  with actual type `([Char], t0)'
      In the expression: ("livro", 10)
      In the first argument of `total', namely
        `[("livro", 10), ("bolachas", 2), ("gelado", 5)]'
      In the expression:
        total [("livro", 10), ("bolachas", 2), ("gelado", 5)]
  
  &lt;interactive&gt;:80:21:
      Couldn't match expected type `[([Char], a0)]'
                  with actual type `([Char], t1)'
      In the expression: ("bolachas", 2)
      In the first argument of `total', namely
        `[("livro", 10), ("bolachas", 2), ("gelado", 5)]'
      In the expression:
        total [("livro", 10), ("bolachas", 2), ("gelado", 5)]
  
  &lt;interactive&gt;:80:36:
      Couldn't match expected type `[([Char], a0)]'
                  with actual type `([Char], t2)'
      In the expression: ("gelado", 5)
      In the first argument of `total', namely
        `[("livro", 10), ("bolachas", 2), ("gelado", 5)]'
      In the expression:
        total [("livro", 10), ("bolachas", 2), ("gelado", 5)]
  </code></pre>
  
  <p>This is probably very simple but as a beginner I was not able to solve this.</p>