title: Haskell - sum a list of lists using foldr/foldl
body: <p>I'm trying to write functions to sum a list of lists (type <code>Integer</code>). I have already done it using <code>map</code>:</p>
  
  <pre><code>summat :: [[Integer]] -&gt; Integer
  summat (x:xs) = sum . map sum $ (x:xs)
  </code></pre>
  
  <p>but can't figure out, how to get it work using <code>foldr</code>/<code>foldl</code>. I tried something like:</p>
  
  <pre><code>summat2 :: [[Integer]] -&gt; Integer
  summat2 xs = foldr suma 0 xs
          where suma x _ = ???
  </code></pre>
  
  <p>but of course it only produces many errors. Do you have any hint for me? Maybe something with <code>concat</code>?</p>