[GHC] #7613: readSigned consumes too much input

#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

#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: ----------------------------------------+----------------------------------- Changes (by liyang): * cc: hackage.haskell.org@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7613#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7613: readSigned consumes too much input ------------------------------------------+--------------------------------- Reporter: liyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 7.6.1 Resolution: wontfix | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect result at runtime | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Changes (by igloo): * status: new => closed * difficulty: => Unknown * resolution: => wontfix Comment: 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 http://www.haskell.org/haskellwiki/Library_submissions -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7613#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7613: readSigned consumes too much input ------------------------------------------+--------------------------------- Reporter: liyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries/base | Version: 7.6.1 Resolution: wontfix | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Incorrect result at runtime | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Comment(by liyang): http://comments.gmane.org/gmane.comp.lang.haskell.libraries/14508 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. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7613#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC