title: Troubles with truncate :: (RealFrac a, Integral b) => a -> b
body: <p>I'm playing with lagrest prime divisor and I have troubles with this code:</p>
  
  <pre><code>lpd :: Integer -&gt; Integer
  lpd n = helper n (2:[3,5..ceiling])
    where
      helper n divisors@(d:ds)
        | n == d         = n
        | n `rem` d == 0 = helper (n `div` d) divisors
        | otherwise      = helper n ds
      ceiling = truncate $ sqrt n
  </code></pre>
  
  <p>The error message is:</p>
  
  <pre><code>problems.hs:52:15:
      No instance for (RealFrac Integer)
        arising from a use of `truncate'
      Possible fix: add an instance declaration for (RealFrac Integer)
      In the expression: truncate
      In the expression: truncate $ sqrt n
      In an equation for `ceiling': ceiling = truncate $ sqrt n
  
  problems.hs:52:26:
      No instance for (Floating Integer)
        arising from a use of `sqrt'
      Possible fix: add an instance declaration for (Floating Integer)
      In the second argument of `($)', namely `sqrt n'
      In the expression: truncate $ sqrt n
      In an equation for `ceiling': ceiling = truncate $ sqrt n
  Failed, modules loaded: none.
  </code></pre>
  
  <p>It seems that my typing is lacking. What could I do to make this code work?</p>