Jerzy Karczmarczuk writes:
 > [...]
 > I would love having 'next' returning reals as well...
 > And vectors (with decently uncorrelated elements). Etc.
 > 
 > Do you think that all that must be manufactured by the user, or
 > can one parameterize the R. Gen. class a bit differently?

Try making each of those types an instance of Random, and using random
instead of next.  Someone (the user or the Haskell implementor) still
has to manufacture the instances, but only once.

 > I haven't follow this discussion since the beginning, so I might
 > try to break an open door. The question is the following: would it
 > be a bad idea to provide a 'randomize' primitive, generating an
 > unexpected random value based on the internal clock or other
 > system properties? I haven't seen that here. It *is* useful.

newStdGen :: IO StdGen

should do the trick.  If you want a generator of a type other than
StdGen, you can always use a StdGen generator to seed it.

Regards,
Tom

Reply via email to