title: Am I using randomRIO wrong?
body: <p>I'm trying to show on Terminal a random number between 1 and 7...</p>
  
  <pre><code>nRandom :: IO ()
  nRandom = do
      number &lt;- randomRIO (1,7)
      putStrLn ("Your random number is: "++show number)   
  </code></pre>
  
  <p>...but ghc doesn't compile it and I get errors like:</p>
  
  <pre><code>No instance for (Random a0) arising from a use of `randomRIO'
  The type variable `a0' is ambiguous
  Possible fix: add a type signature that fixes these type variable(s)
  Note: there are several potential instances:
    instance Random Bool -- Defined in `System.Random'
    instance Random Foreign.C.Types.CChar -- Defined in `System.Random'
    instance Random Foreign.C.Types.CDouble
      -- Defined in `System.Random'
    ...plus 33 others
  In a stmt of a 'do' block: number &lt;- randomRIO (1, 7)
  In the expression:
    do { number &lt;- randomRIO (1, 7);
         putStrLn ("Your random number is: " ++ show number) }
  In an equation for `nRandom':
      nRandom
        = do { number &lt;- randomRIO (1, 7);
               putStrLn ("Your random number is: " ++ show number) }
  </code></pre>
  
  <p>and,</p>
  
  <pre><code>No instance for (Num a0) arising from the literal `1'
  The type variable `a0' is ambiguous
  Possible fix: add a type signature that fixes these type variable(s)
  Note: there are several potential instances:
    instance Num Double -- Defined in `GHC.Float'
    instance Num Float -- Defined in `GHC.Float'
    instance Integral a =&gt; Num (GHC.Real.Ratio a)
      -- Defined in `GHC.Real'
    ...plus 37 others
  In the expression: 1
  In the first argument of `randomRIO', namely `(1, 7)'
  In a stmt of a 'do' block: number &lt;- randomRIO (1, 7)
  </code></pre>
  
  <p>Can anyone say me what am I doing wrong? Thanks ;)</p>