title: How to use list comprehension in Haskell?
body: <p>I am trying to teach myself Haskell and I am doing random exercises. 
  I was supposed to write a code that will do this 6 = [1*1 + 3*3 + 5*5]= 35
  So  I had to filter out all odd numbers and then calculate the sum if I multiply every single one with itself. </p>
  
  <pre><code> sumquad n = (potenzsum(filter odd (ones n)))
       where
       potenzsum [x] = x*x
       potenzsum [x,y] = x*x + y*y
       potenzsum (x:xs) = x + potenzsum xs
  
  ones 0 = []
  ones x = [ 1 .. x] 
  </code></pre>
  
  <p>This code works ;) 
  Now I am supposed to do the same thing but with list comprehension (I am allowed to use this list [1...n]</p>
  
  <p>I could only think of this... Could someone help me?</p>
  
  <pre><code>power1 xs = [x*x | x &lt;- xs]
  </code></pre>