
#7613: readSigned consumes too much input ----------------------------------------+----------------------------------- Reporter: liyang | Owner: Type: bug | Status: new Priority: normal | Component: libraries/base Version: 7.6.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect result at runtime | Blockedby: Blocking: | Related: ----------------------------------------+----------------------------------- {{{
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. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7613 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler