Skip to content

lex doesn't handle binary literals

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).

Trac metadata
Trac field Value
Version 7.10.1-rc2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC ekmett, hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information