[Haskell-cafe] New user, pardon what may be a dumb question

Lemmih lemmih at gmail.com
Thu Mar 31 13:10:50 EST 2005

On Mar 31, 2005 7:56 PM, Mark Goldman <bitshifter at gmail.com> wrote:
> I am using ghci to learn Haskell.  My question is it possible to
> assign an object that contains state (for lack of knowing the proper
> terminology) so a variable or some such from the interactive prompt.
> More concretely I would like to do something like this non-working code snippet:
> System.Random> x <- return (mkStdGen 45)
> System.Random> random x :: (int, StdGen)
> Thanks

Just change 'int' to 'Int'.

Prelude System.Random> let x = mkStdGen 45
Prelude System.Random> random x :: (Int,StdGen)
(-1175339331,637087874 1655838864)


More information about the Haskell-Cafe mailing list