[GHC] #15646: ghci takes super long time to find the type of large fractional number

GHC ghc-devs at haskell.org
Tue Oct 16 06:59:32 UTC 2018


#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 osa1):

 Right, so there's a brief discussion about this in comment:29, however we
 can't
 convert a `Rational` to the new `FractionalLit` type so the idea doesn't
 quite
 work. Changing TH syntax is not easy becuase it's a user-facing type
 (would need
 a proposal). One idea comes to mind is to make `FractionalLit` a sum type,
 with
 an alternative for the old `FractionalLit` values:

 {{{
 data FractonalLit
   = FL { ... }
   -- | TemplateHaskell fractional lit: we lose information during
 conversion
   -- from Haskell syntax to TH syntax (happens when desugaring
 quasiquotes, in
   -- DsMeta) where we convert a `FL` to a `Rational` because that's what
 TH
   -- syntax wants.
   | THFL
       { fl_text :: SourceText
       , fl_next :: Bool
       , fl_value :: Rational
       }
 }}}

 Then we can propose a change to the TH syntax, depending on the result we
 can
 remove the `THFL` constructor.

 Alternatively, Simon suggests finding an approximate conversion of a
 `Rational`
 to the new `FractionalLit` in comment:30. That'd fine to get the code to
 compile
 but it won't be mergeable until the conversion is fixed.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15646#comment:37>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list