title: Cannot scan list of numbers into list of tuples
body: <p>I'm trying to scan a list of lists and return a list of 2-tuples, the first item the sublist, and the second the sum of the sublist. Here is the function:</p>
  
  <pre><code>listToTups :: (Num a) =&gt; [[a]] -&gt; [([a], a)]
  listToTups x = scanl (\acc item -&gt; (item, sum item) : acc) [] x
  </code></pre>
  
  <p>When I try to compile I get this error:</p>
  
  <pre><code>Couldn't match expected type `([a], a)' with actual type `[a0]'
      In the second argument of `scanl', namely `[]'
      In the expression:
        scanl (\ acc item -&gt; (item, sum item) : acc) [] x
  </code></pre>
  
  <p>This doesn't make sense since the lambda function is clearly returning a list of tuples. What am I doing wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This is what I'm trying to do. Given a list of [Int], I want to return a list of 2-tuples, the first element being the sublist itself, and the second being the sum. So something like:</p>
  
  <pre><code>[[1,2,3], [4,5,6]] -&gt; [([1,2,3], 6), ([4,5,6], 15)]
  </code></pre>
  
  <p>How can I do this?</p>