title: How do I use multiple where clauses in GHCi?
body: <p>I'm playing around with GHCi for the first time, and I'm having some trouble writing multi-line functions.
  My code is as follows:</p>
  
  <pre><code>Prelude&gt; :{
  Prelude| let diffSquares lst = abs $ squareOfSums lst - sumOfSquares lst
  Prelude|   where
  Prelude|     squareOfSums lst = (fst (sumsAndSquares lst))^2
  Prelude|     sumOfSquares lst = snd (sumsAndSquares lst)
  Prelude|     sumsAndSquares = foldl (\(sms,sqrs) x -&gt; (sms+x,sqrs+x^2)) (0,0)
  Prelude| :}
  </code></pre>
  
  <p>It gives the following error:</p>
  
  <pre><code>&lt;interactive&gt;:1:142: parse error on input `='
  </code></pre>
  
  <p>Could someone kindly point me in the direction of what I'm missing?</p>