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

GHC ghc-devs at haskell.org
Sun Sep 16 14:44:50 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 JulianLeviston):

 Seems to be picking `Double` as the type... I noticed that `Double` over
 `1e309` parses as `Infinity`...

 {{{#!shell
 ghc git:(master) ✗ time ./inplace/bin/ghc-stage2 blah2.hs -ddump-tc -dppr-
 debug
 [1 of 1] Compiling Blah2            ( blah2.hs, blah2.o )
 TYPE SIGNATURES
   (main:Blah2.$trModule{v r1} [lidx] :: ghc-prim:GHC.Types.Module{tc 622})
 ::
     ghc-prim:GHC.Types.Module{tc 622}
   (main:Blah2.largeValue{v rpX} [lid] :: ghc-prim:GHC.Types.Double{(w) tc
 3k}) ::
     ghc-prim:GHC.Types.Double{(w) tc 3k}
 TYPE CONSTRUCTORS
 COERCION AXIOMS
 Dependent modules: []
 Dependent packages: [base, ghc-prim, integer-gmp]
 blah2.hs:1:1:

     ==================== Typechecker ====================
     {<no location info>}
     ((main:Blah2.$trModule{v r1} [lidx] :: ghc-prim:GHC.Types.Module{tc
 622})
        :: ghc-prim:GHC.Types.Module{tc 622})
       = ghc-prim:GHC.Types.Module{d 625}
           {<no location info>}
           (ghc-prim:GHC.Types.TrNameS{d 62b}
              {<no location info>}
              "main"#)
           {<no location info>}
           (ghc-prim:GHC.Types.TrNameS{d 62b}
              {<no location info>}
              "Blah2"#)
     {blah2.hs:3:1-22}
     {blah2.hs:3:1-22}
     (largeValue{v aLS} [lid] :: ghc-prim:GHC.Types.Double{(w) tc 3k})
       :: ghc-prim:GHC.Types.Double{(w) tc 3k}
     [LclId]
     main:Blah2.largeValue{v rpX}
       = {blah2.hs:3:14-22}
         1e1000000 (base:GHC.Real.fromRational{v 02C}
                      {<no location info>}
                      1e1000000)
     <>

 ./inplace/bin/ghc-stage2 blah2.hs -ddump-tc -dppr-debug  0.27s user 0.21s
 system 96% cpu 0.505 total
 }}}

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


More information about the ghc-tickets mailing list