title: Couldn't match expected type 'Double' with actual type 'Int' in haskell
body: <p>I'm very new to Haskell, and I couldn't find the error in the following code:</p>
  
  <pre><code>arithmeticMean :: [Double] -&gt; Double
  arithmeticMean list = (sum list) / (length list)
  </code></pre>
  
  <p>I typed this into notepad, save it as "mean.hs", and tried to run it.</p>
  
  <p>In GHCI, I typed :load mean and got the following error:</p>
  
  <pre><code>mean.hs:2:37:
  Couldn't match expected type 'Double' with actual type 'Int'
  In the second argument of '(/)', namely '(length list)'
  In the expression: (sum list) / (length list)
  Failed, modules loaded: none.
  </code></pre>
  
  <p>I apologize if I made a very trivial mistake, but I just don't see the problem. The function takes a list [Double], finds its sum, getting a double. Length takes any list and gives an int. I then divide a double by an int and return it. Why the error?</p>