title: Haskell parse error, for averaging program
body: <p>I need to get the average, so input is stopped until user puts in a negative number and then the output is the average</p>
  
  <pre><code>  {
      getFloat :: IO Float
      getFloat = do line &lt;- getLine
                      return (read line:: Float) 
  
  
      average :: IO Float
      average =  helper summ n
                      where
                      helper :: Float-&gt;Float-&gt;IO Float
                      helper summ n = do val&lt;-getFloat
                                         if (val&lt;0)
                                            then (return average)
                                            else ( do summ = summ + val
                                                      n = n+1
                                                      average= summ/n
                                                      average)
                                                           }
  </code></pre>