daniel.is.fischer at web.de
Wed Oct 6 16:33:04 EDT 2010
On Wednesday 06 October 2010 22:02:57, Conor McBride wrote:
> There's probably a place to report this properly, but I thought if
> I mentioned it here, you could throw cabbages at me and tell me
> where to go.
Decide whether you regard it as a documentation bug or a wrong result at
(Documentation bug seems more reasonable)
> Exhibit A, from
> "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
Note that that should be uppercase, Read.
> following properties:
> * It guarantees to succeed on any string."
It does in the sense that
reads foo :: [(StdGen,[Char])] /= 
for all foo. The way it's formulated invites wrong interpretations, though.
> Exhibit B, from ghci
> Prelude System.Random> read "00-00-00-00-00-00" :: StdGen
> Loading package old-locale-22.214.171.124 ... linking ... done.
> Loading package time-1.1.4 ... linking ... done.
> Loading package random-126.96.36.199 ... linking ... done.
> *** Exception: Prelude.read: no parse
> The prosecution rests.
More information about the Libraries