[GHC] #10092: lex doesn't handle binary literals

#10092: lex doesn't handle binary literals -------------------------------------+------------------------------------- Reporter: | Owner: RyanGlScott | Status: new Type: bug | Milestone: Priority: normal | Version: 7.10.1-rc2 Component: | Operating System: Unknown/Multiple libraries/base | Type of failure: Incorrect result Keywords: | at runtime Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The {{{lex}}} function from {{{Text.Read.Lex}}} (on which the {{{Read}}} instance for {{{Lexeme}}} is based) can't read binary literals on GHC 7.10.1-rc2: {{{ $ ghci -XBinaryLiterals GHCi, version 7.10.0.20150123: http://www.haskell.org/ghc/ :? for help λ> 0b101010 42 λ> import Text.Read.Lex λ> read "0b101010" :: Lexeme *** Exception: Prelude.read: no parse }}} This should be a simple fix, but I'm not sure if this is the intended behavior or not, since {{{BinaryLiterals}}} isn't a part of the Haskell 2010 standard (and I'm not sure how closely {{{lex}}} adheres to that). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10092 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10092: lex doesn't handle binary literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ekmett Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | BinaryLiterals report-impact Type of failure: Incorrect result | Architecture: at runtime | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #9224 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by hvr): * cc: core-libraries-committee@… (added) * keywords: => BinaryLiterals report-impact * component: libraries/base => Core Libraries * related: => #9224 * owner: => ekmett -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10092#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10092: lex doesn't handle binary literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ekmett Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | BinaryLiterals report-impact Type of failure: Incorrect result | Architecture: at runtime | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #9224 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ekmett): Given that `read` and `show` should have portable behavior across implementations, it seems to me that we should _not_ support binary literals in `read`/`lex`. Otherwise we invite the endless waves of portability problems that ensue from the "be liberal in what you accept, strict in what you output" dogma. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10092#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10092: lex doesn't handle binary literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ekmett Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | BinaryLiterals report-impact Type of failure: Incorrect result | Architecture: at runtime | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #9224 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by RyanGlScott): I'm OK with that, I just wanted to confirm that {{{lex}}} was in fact meant to adhere to a portable implementation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10092#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10092: lex doesn't handle binary literals -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: ekmett Type: bug | Status: closed Priority: normal | Milestone: Component: Core Libraries | Version: 7.10.1-rc2 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | BinaryLiterals report-impact Type of failure: Incorrect result | Architecture: at runtime | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #9224 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10092#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC