#2470: read for StdGen fails for arbitrary string
------------------------------+---------------------------------------------
Reporter: guest | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: libraries/random | Version: 6.8.3
Severity: normal | Resolution: invalid
Keywords: StdGen read | Difficulty: Unknown
Testcase: | Architecture: x86
Os: Windows |
------------------------------+---------------------------------------------
Comment (by Isaac Dupree):
IMHO it would be appropriate to specify in the documentation that
(read::String->StdGen) is only guaranteed to work on the result of
(show::StdGen->String). The "read 6 characters" can be mentioned as an
implementation detail. (Then it's just like all other read/show pairs: it
works fine in tuples.) That leaves us free to / forces us to come up with
a more proper suite of functions for initializing a generator (for
example, taking all the bits in a finite list into account, initializing
from an Int, from an Integer, etc.)
-Isaac
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2470#comment:4>
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