[GHC] #12860: GeneralizedNewtypeDeriving + MultiParamTypeClasses sends typechecker into an infinite loop

GHC ghc-devs at haskell.org
Mon Nov 21 04:50:26 UTC 2016


#12860: GeneralizedNewtypeDeriving + MultiParamTypeClasses sends typechecker into
an infinite loop
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
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 rwbarton):

 Well before 8.0, it results in a context reduction stack overflow
 reasonably quickly.

 The code is extremely dubious anyways, since the derived instance would
 have form
 {{{#!hs
 instance C b a => C b (Foo a) where ...
 }}}

 But if you could actually satisfy the context `C b a`, then you would be
 disallowed from writing the instance `C b (Foo a)` by the functional
 dependency. So the derived instance should be useless.

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


More information about the ghc-tickets mailing list