New user, pardon what may be a dumb question

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

On Mar 31, 2005 7:56 PM, Mark Goldman
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) -- Friendly, Lemmih
participants (2)
-
Lemmih
-
Mark Goldman