
#5692: Source code with large floating constants in exponential notation cannot be compiled -------------------------------------+------------------------------------- Reporter: gracjan | Owner: pcapriotti Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: 5688 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by WrenThornton): * cc: wren@… (added) Comment: FWIW, the [http://hackage.haskell.org/package/bytestring-lexing bytestring-lexing] library has extremely efficient implementations of reading real literals for types which have limited precision (e.g., `Float` and `Double`). The functions in question are `readDecimalLimited` and `readExponentialLimited` in `Data.ByteString.Lex.Fractional`. The repo for the package also includes benchmarks. Surely GHC doesn't need to optimize lexing quite so much as bytestring- lexing has done, but in the interest of minimizing code duplication/maintenance, I would be totally fine having bytestring-lexing become one of the core libraries GHC uses. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/5692#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler