random gremlin

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


M'luds,

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-1.0.0.2/System-Random.html

   "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-1.0.0.2 ... linking ... done.
   Loading package time-1.1.4 ... linking ... done.
   Loading package random-1.0.0.2 ... linking ... done.
   *** Exception: Prelude.read: no parse

The prosecution rests.

Conor



More information about the Libraries mailing list