Read instance of StdGen returns no parse
Denis Bueno
dbueno at gmail.com
Sat Jan 26 15:21:00 EST 2008
Hi all,
According to http://haskell.org/ghc/docs/latest/html/libraries/random/System-Random.html#t%3AStdGen
the Read StdGen instance should never fail. However, in GHC 6.8.2, it
appears to:
> ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude> :m System.Random
Prelude System.Random> read "exsqueeze me" :: 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> Leaving GHCi.
It first fails for me on strings of length seven. Is this a bug, or
have I done something wrong?
--
Denis
More information about the Glasgow-haskell-users
mailing list