
#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: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by JulianLeviston): Ok, so I tried to tackle this again today. The very first thing I did was to refactor `data FractionalLit` as suggested, then follow the type errors. Firstly I wasn't 100% sure how to best approach a workflow, so I tried using GHCi and loading the BasicTypes module in, but that failed because of missing dependencies, so then I tried to use `make fast -j3` in the `ghc/compiler` directory and that seemed to work out ok in terms of speed. I was initially worried it was going to take too long, but it's fine. So, adjusting `FractionalLit` is fine. I made the change, then it complained bout `mkFractionalLit` being incorrect, as I'd expect. I'm not 100% sure of the intent of `mkFractionalLit`, though — it looks like it's a simple constructor; when I compare it to `mkIntegralLit`, etc, and when I looked up the use-sites it appears to passing a Rational value still makes sense, so I thought I'd keep that. Then I realised I'm going to have to effectively implement something like an adjusted version of `fromBaseRational 10` from https://hackage.haskell.org/package/numeric- prelude-0.4.3/docs/src/Number-Positional.html#fromBaseRational to find the mantissa and exponent. Am I barking up the right tree here? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15646#comment:26 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler