[GHC] #12768: 8.0.2 derives invalid code when class method is constrained by itself

GHC ghc-devs at haskell.org
Wed Nov 2 14:39:06 UTC 2016


#12768: 8.0.2 derives invalid code when class method is constrained by itself
-------------------------------------+-------------------------------------
        Reporter:  jophish           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * cc: bgamari (added)


Comment:

 That's a very good point about `D [a]` and `D (N a)` not being inter-
 coercible in general w.r.t the class `C`. It sound like in order to make
 this work for the special case of `D = C`, we'd have to equip GHC with
 some special knowledge that the `C (N a)` instance was generated through
 GND, which sounds quite gross.

 So now the question becomes: should we avoid backporting
 96d451450923a80b043b5314c5eaaa9d0eab7c56 to 8.0.2 since it causes some
 programs which compile in 8.0.1 to fail in 8.0.2? Or should we simply add
 a section to the release notes explaining the scenario, and recommend the
 (admittedly simple) workaround?

 Ben, do you have any thoughts on this?

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


More information about the ghc-tickets mailing list