#2470: read for StdGen fails for arbitrary string
----------------------------+-----------------------------------------------
    Reporter:  guest        |       Owner:                  
        Type:  bug          |      Status:  new             
    Priority:  normal       |   Component:  libraries/random
     Version:  6.8.3        |    Severity:  normal          
    Keywords:  StdGen read  |    Testcase:                  
Architecture:  x86          |          Os:  Windows         
----------------------------+-----------------------------------------------
 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-1.0.0.0 ... linking ... done.
 Loading package old-time-1.0.0.0 ... linking ... done.
 Loading package random-1.0.0.0 ... linking ... done.
 *** Exception: Prelude.read: no parse
 Prelude System.Random>

 You can contact me at [EMAIL PROTECTED] if you need more information.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2470>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to