readSigned consumes too much input
> reads "0.1" :: [(Int, String)]
[]
I would have expected [(0, ".1")]
. The Report specifies that reads
for Int
ought to essentially be readSigned readDec
, and indeed readDec
gives the expected result:
> readDec "0.1"
[(0,".1")]
I think the bug is due to the use of lex
in readSigned
, which consumes the entire "0.1" string, such that readDec no longer gives a clean parse.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |