title: ghci randomio type inference
body: <p>I am following <a href="https://en.wikibooks.org/wiki/Haskell/Understanding_monads/State" rel="nofollow">https://en.wikibooks.org/wiki/Haskell/Understanding_monads/State</a>, and <code>randomIO</code> prints an integer in <code>ghci</code> directly. Given its type is polymorphic, how does <code>ghci</code> know it's <code>Int</code> here? Are there some special rules for type inference in <code>ghci</code>?</p>
  
  <pre><code>GHCi&gt; :m System.Random
  GHCi&gt; :t randomIO
  randomIO :: Random a =&gt; IO a
  GHCi&gt; randomIO
  -1557093684
  GHCi&gt; randomIO
  1342278538
  </code></pre>