[GHC] #9761: Foldable cannot be derived by GND due to redundant contexts

GHC ghc-devs at haskell.org
Mon Nov 3 18:25:46 UTC 2014


#9761: Foldable cannot be derived by GND due to redundant contexts
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:  dfeuer
                  Type:  bug         |           Status:  patch
              Priority:  normal      |        Milestone:
             Component:  Core        |          Version:  7.9
  Libraries                          |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  GHC         |  Related Tickets:
  rejects valid program              |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D425   |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 As Mr. Role, I agree with the analysis reported in comment:2.

 (But, just to be pedantic, I disagree with the phrasing in comment:3.
 `Foldable` should most certainly have a nominal role on its parameter,
 because we don't want to be able to coerce an existentially-bound
 `Foldable` dictionary, as `Foldable MyList` and `Foldable []` might be
 different. However, the extra `Foldable` constraints do cause GND to fail,
 because the constraint gets instantiated before coercing, and then it
 looks like we're trying to coerce `Foldable []` to `Foldable MyList`,
 which is bad.)

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


More information about the ghc-tickets mailing list