title: Ambiguous type variable `a0' arising from a use of `it'
body: <p>I have the following function to return the Factor Pairs for a given number</p>
  
  <pre><code>factorPairs:: (RealFrac a, Floating a, Integral a) =&gt; a -&gt; [(a, a)]
  factorPairs n = map(\x -&gt; (x, div n x)) [y | y &lt;- [1..(ceiling $ sqrt n)], n `rem` y == 0]
  </code></pre>
  
  <p>When I call the function in ghci <code>factorPairs 18</code> I'm getting a run time error of </p>
  
  <pre><code>   * Ambiguous type variable `a0' arising from a use of `it'
        prevents the constraint `(Floating a0)' from being solved.
        Probable fix: use a type annotation to specify what `a0' should be.
        These potential instances exist:
          instance Floating Double -- Defined in `GHC.Float'
          instance Floating Float -- Defined in `GHC.Float'
      * In the first argument of `print', namely `it'
        In a stmt of an interactive GHCi command: print it
  </code></pre>
  
  <p>I can hard code the function in ghci </p>
  
  <p><code>map(\x -&gt; (x, div 18 x)) [y | y &lt;- [1..(ceiling $ sqrt 18)], 18 `rem` y == 0]</code>
   and don't have any issues but I can't seem to figure out why my function is failing. I believe ghci is trying to tell me it can't figure out what type to call <code>print</code> with but am struggling to find the solution.</p>