title: Why does Haskell appear to default to reading Int when reading Num?
body: <p>I didn't expect the following code to work:</p>
  
  <pre><code>foo :: (Num a) =&gt; a -&gt; a
  foo x = x + x
  
  main = do
      print (foo (read "7"))
  </code></pre>
  
  <p>because it is not possible to fully infer the type of (read "7") based on the code. But GHC (6.12.3) thinks otherwise and prints 14.</p>
  
  <p>If "7" is changed to "7.2", the code fails with "no parse". What's going on here? how is Haskell deciding which instance of Read to use?</p>