
#15646: ghci takes super long time to find the type of large fractional number -------------------------------------+------------------------------------- Reporter: Johannkokos | Owner: | JulianLeviston Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: GHCi | Version: 8.4.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #5692 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by JulianLeviston): Here is the current summary of what I've been intending to do: Problem is excessive duration of typechecking large fractionals. Initial issue was renamer and desugarer were consructing the rational before typechecking. The plan that has been implemented is to adjust FractionalLit to store the significand and the exponent, as well as the FractionalExponentBase (because the fractional *may* be hex or dec) instead of just a rational, and to parse the source as an application of a new library functions `mkFractionalLit` and `mkTHFractionalLit`. In the process we also added a new core expression `mkRationalExpr` Template haskell still uses a rational to represent its fractional lits, so we have *two* constructors in the FractionalLit type: FL and THFL (one for regular literals and one for Template Haskell literals). We also had to adjust the lexer in the parser to deal with parsing the values into the new forms. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15646#comment:66 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler