[GHC] #10371: GHC fails to inline and specialize a function

GHC ghc-devs at haskell.org
Sat May 2 10:20:22 UTC 2015


#10371: GHC fails to inline and specialize a function
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:  #8668             |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by MikeIzbicki):

 I figured out a solution that works for me.  Inside my class hierarchy
 there were several definitions that are similar to type synonyms:
 {{{
 class (Rg r, Group r) => Rng r
 instance (Rg r, Group r) => Rng r
 }}}
 instead of:
 {{{
 type Rng r = (Rg r, Group r)
 }}}
 Replacing these definitions with actual type synonyms fixed the problem.

 I was using the original version for two reasons.  First, GHC 7.8 lacks
 ConstraintKinds support in TemplateHaskell.  This is obviously not
 relevant after the upgrade to 7.10.  Second, There are places where I
 would prefer to be able to partially apply the constraint, which you can't
 do as a type synonym.  I can live without partial application, but it
 would be nice to have back.

 Unfortunately, these class definitions are not the sole cause of the
 problem.  I tried recreating the relevant subset of my class hierarchy in
 another file.  But I couldn't reproduce the problem using only this subset
 of code.  So these classes must somehow be interacting with another part
 of the library which (seems to be) unrelated.  Tracking down this other
 cause and giving a nice short test case here seems like more work than I
 can put into this since I have a workaround.

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


More information about the ghc-tickets mailing list