random gremlin

Conor McBride conor at strictlypositive.org
Wed Oct 6 16:02:57 EDT 2010


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.

Exhibit A, from http://haskell.org/ghc/docs/6.12.2/html/libraries/random-

   "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."

Exhibit B, from ghci

   Prelude System.Random> read "00-00-00-00-00-00" :: StdGen
   Loading package old-locale- ... linking ... done.
   Loading package time-1.1.4 ... linking ... done.
   Loading package random- ... linking ... done.
   *** Exception: Prelude.read: no parse

The prosecution rests.


More information about the Libraries mailing list