[GHC] #3064: Very long compile times with type functions

GHC ghc-devs at haskell.org
Tue Dec 23 18:59:16 UTC 2014


#3064: Very long compile times with type functions
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:
                  Type:  bug         |           Status:  closed
              Priority:  low         |        Milestone:  7.12.1
             Component:  Compiler    |          Version:  6.10.1
  (Type checker)                     |         Keywords:
            Resolution:  fixed       |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Compile-    |  Related Tickets:
  time performance bug               |
             Test Case:              |
  perf/compiler/T3064                |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by goldfire):

 * milestone:  7.6.1 => 7.12.1


Comment:

 From the second-to-last bullet point in Simon's commit message, it looks
 like this is a breaking change and should not be merged into 7.10 since
 RC1 is already out.

 I have to say the breakage is a little disappointing here. Here is the
 real-life example from the Note:

 {{{
         class Ord r => UserOfRegs r a where ...
 (i1)    instance UserOfRegs r a => UserOfRegs r (Maybe a) where ...
 (i2)    instance (Ord r, UserOfRegs r CmmReg) => UserOfRegs r CmmExpr
 where ...
 }}}

 Note the `Ord r` constraint in `(i2)`, which is newly-required by this
 change. What's disappointing here is that `Ord r` is "obviously" derivable
 from `UserOfRegs r CmmReg`! While I understand the reasoning in the Note
 (that `UserOfRegs r CmmReg` is not strictly smaller than the instance
 head, and therefore looking in its superclasses might, in perverse but
 realistic scenarios, might cause the superclass dictionary to loop), it's
 far from obvious from a user standpoint.

 Is it possible to alert the user to this problem in an error message? It
 seems, from the diff, that this is not yet done.

 And, should this perhaps be the first 7.12 release note? As it's a
 breaking change, I do think it should be called out in the user manual.

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


More information about the ghc-tickets mailing list