read for StdGen fails for arbitrary string
|Reported by:||guest||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
According to the docs for StdGen:
"In addition, read may be used to map an arbitrary string (not necessarily one produced by show) onto a value of type StdGen. In general, the read instance of StdGen has the following properties:
- It guarantees to succeed on any string.
- It guarantees to consume only a finite portion of the string.
- Different argument strings are likely to result in different results."
Here's what happens on my system:
C:\odm\ghc\lib>ghci GHCi, version 6.8.3: http://www.haskell.org/ghc/ :? for help Loading package base ... linking ... done. Prelude> :mod +System.Random Prelude System.Random> (read "tasty tofu") :: StdGen Loading package old-locale-126.96.36.199 ... linking ... done. Loading package old-time-188.8.131.52 ... linking ... done. Loading package random-184.108.40.206 ... linking ... done. * Exception: Prelude.read: no parse Prelude System.Random>
You can contact me at orielmaxime@… if you need more information.
Change History (7)
comment:2 follow-up: 5 Changed 9 years ago by
|Status:||new → closed|