title: mod function and type classes in haskell
body: <p>i have this line of code in haskell, where <code>level :: Float</code>, and  <code>y :: Int</code>, </p>
  
  <pre><code>mod (floor(fromIntegral y + (level/2))) (floor level)
  </code></pre>
  
  <p>and ghci returns me the following:</p>
  
  <pre><code>No instance for (Integral Float)
    arising from a use of `mod'
  Possible fix: add an instance declaration for (Integral Float)
  </code></pre>
  
  <p>i try several versions using fromIntegral and floor for example</p>
  
  <pre><code>mod (( y + (floor $ level/2))) (floor level) 
  </code></pre>
  
  <p>where i tryed to convert <code>level/2</code> to an integral, but the same answer is allways returned </p>
  
  <p>I know i have to give mod both Integral arguments, so i can't figure out why the code is wrong ... </p>