#1272: newStdGen returns the same value on successive calls
----------------------+-----------------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
----------------------+-----------------------------------------------------
Comment (by guest):
Some more comments/experiments on this.
(I'd submit a patch, but I don't understand the rationale behind the
current implementation.)
* Successive invocations of getClockTime always gives me different
results - even if the fraction is in even millions (i.e. µs). So using
the fraction would work on GHC at least. Presumably there is a reason
this isn't done already?
* Initializing on modern Unixes (at least Linux and Solaris) should
probably be from reading from /dev/urandom (/dev/random may block waiting
for entropy - if an application depends on true randomness that
critically, I think it should handle it manually.) The current Read
instance fails if it is fed strings longer than six characters, and the
resulting StdGens from when it works appear limited in range. This is
probably not critical(?)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1272>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs