title: Haskell - Instance of Fractional Int required for definition of filename?
body: <p>I'm an amateur at Haskell, trying to run through an infinite list of approximations to the square root of "x", where "acc" represents the generation this step is on. However, when I run the code below, I get the underlying error.</p>
  
  <pre><code>as' x acc = ( last(take (acc-1) (as' x (acc-1)))
  + (acc / last(take (acc-1) (as' x (acc-1)))) ) / 2 : as' x (acc+1)
  </code></pre>
  
  <p><code>ERROR "a5.hs":34 - Instance of Fractional Int required for definition of as'</code></p>
  
  <p>Also, when I try applying this type code, I get an error:</p>
  
  <pre><code>as' :: Float -&gt; Float -&gt; Float
  </code></pre>
  
  <p><code>Type error in application<br>
  *** Expression     : (last (take (acc - 1) (as' x (acc - 1))) + acc / last (take (acc - 1) (as' x (acc - 1)))) / 2 : as' x (acc + 1)<br>
  *** Term           : as' x (acc + 1)<br>
  *** Type           : Float<br>
  *** Does not match : [a]</code></p>
  
  <p>EDIT: To offer you some clarity, I want to use this function in the context of a list.
  e.g. as x = [1, as' x 2].
  The idea is that this will accumulate an infinite list, since as' will recursively call itself. Hence why I felt I could operate on a list here.</p>
  
  <p>Can anyone please offer me some clarity?</p>