Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7613 closed bug (wontfix)

readSigned consumes too much input

Reported by: liyang Owned by:
Priority: normal Milestone:
Component: libraries/base Version: 7.6.1
Keywords: Cc:…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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

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.

Change History (3)

comment:1 Changed 4 years ago by liyang

Cc:… added

comment:2 Changed 4 years ago by igloo

difficulty: Unknown
Resolution: wontfix
Status: newclosed

As far as I can see, we're following the report here. If you'd like to propose a change in the behaviour, please see

comment:3 Changed 4 years ago by liyang

Just found the above thread. Turns out this is a duplicate of #4500. I ended up with Attoparsec on UTF-8 ByteStrings which behaves the way I expect, and is about 5x faster.

Note: See TracTickets for help on using tickets.