title: Haskell code to compute sum of squares of negative integers using foldr function
body: <p>I am new to haskell code. I tried to compute the sum of squares of negative integer in a list using foldr high order. </p>
  
  <pre><code>  sumsq :: Int -&gt; Int
    sumsq n = foldr op 0 [1..n]
    where op x y = x*x + y
  </code></pre>
  
  <p>Please help to explain each line of code and give any solution if error in this code</p>