
#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): I've been trying to move `mkRational`, but it doesn't seem to make any sense to put it into base itself... (ie `GHC.Real`). If we put it into there, won't it expose it to base? It seems like a strange thing to do, to me. The reason it needs to be exposed *somewhere* is that it's looked up globally by id, here: https://github.com/JulianLeviston/ghc/pull/1/files #diff-116aa33edfc74c0dc68e471f30ac63d5R101 but perhaps we don't actually need to look it up there? I'm pretty lost. Here's the code... it's the bottom of the `dsLit` function in `compiler/deSugar/Matchlit.hs`: {{{ HsRat _ fl _ -> case fl of FL { fl_signi = fl_signi, fl_exp = fl_exp } -> do mkRational <- dsLookupGlobalId mkRationalName litI <- mkIntegerExpr fl_signi litE <- mkIntegerExpr fl_exp return ((Var mkRational) `App` litI `App` litE) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15646#comment:63 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler