title: Rounding fractional values to Int
body: <p>Im trying to learn Haskell but I got stuck on the numbers conversions, could someone explain why Haskell compiler is going mad on this code:</p>
  
  <pre><code>phimagic :: Int -&gt; [Int]
  phimagic x = x : (phimagic (round (x * 4.236068)))
  </code></pre>
  
  <p>It prints the error message:</p>
  
  <pre><code>problem2.hs:25:33:
      No instance for (RealFrac Int) arising from a use of `round'
      Possible fix: add an instance declaration for (RealFrac Int)
      In the first argument of `phimagic', namely
        `(round (x * 4.236068))'
      In the second argument of `(:)', namely
        `(phimagic (round (x * 4.236068)))'
      In the expression: x : (phimagic (round (x * 4.236068)))
  
  
  problem2.hs:25:44:
      No instance for (Fractional Int)
        arising from the literal `4.236068'
      Possible fix: add an instance declaration for (Fractional Int)
      In the second argument of `(*)', namely `4.236068'
      In the first argument of `round', namely `(x * 4.236068)'
      In the first argument of `phimagic', namely
        `(round (x * 4.236068))'
  </code></pre>
  
  <p>I already have tried a number of combinations on the method signature (adding Integral, Fractional, Double, etc). Something is telling me that that literal 4.236068 has something to do with the problem but cant figure it out.</p>