
#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 osa1):
I can't print out litE and litI because they don't have a show instance for Core
In GHC you should be using `Outputable` instances (with `pprTrace` and frieds). Most GHC types don't have a `Show` instance, but most have `Outputable`. In this case `pprTrace "..." (text "litI:" <+> ppr litI <+> "litE:" <+> ppr litE)` should work.
So... yeah, this is what happens when I run it:
Right, so the problem is in your `mkRational` name definition: {{{ mkRationalName = tcQual gHC_REAL (fsLit "mkRational") mkRationalIdKey }}} You're saying that `mkRational` lives in `GHC.Real`, but that's not the case. It actually lives in the GHC module `BasicTypes`. We need to put `mkRational` to somehwere in `base`. `GHC.Real` is a good place I think. Secondly, I see some uses of `mkRational` in `BasicTypes`. Those also need to be moved, because when booting GHC, when building stage 1, we'll be using a GHC that won't have `mkRational` in `GHC.Real`. So all those definitions that use `mkRational` need to be moved to `GHC.Real` too. Does this make sense? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15646#comment:60 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler