[GHC] #14179: "Conflicting family instance" error pretty prints data family instances poorly

GHC ghc-devs at haskell.org
Thu Nov 8 15:38:22 UTC 2018


#14179: "Conflicting family instance" error pretty prints data family instances
poorly
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:  fixed             |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Poor/confusing    |            Test Case:  indexed-
  error message                      |  types/should_fail/T14179
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4711
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"63a817074a8d49798bfd46a6545906fff143e924/ghc"
 63a81707/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="63a817074a8d49798bfd46a6545906fff143e924"
 Fix #15845 by defining etaExpandFamInstLHS and using it

 Summary:
 Both #9692 and #14179 were caused by GHC being careless
 about using eta-reduced data family instance axioms. Each of those
 tickets were fixed by manually whipping up some code to eta-expand
 the axioms. The same sort of issue has now caused #15845, so I
 figured it was high time to factor out the code that each of these
 fixes have in common.

 This patch introduces the `etaExpandFamInstLHS` function, which takes
 a family instance's type variables, LHS types, and RHS type, and
 returns type variables and LHS types that have been eta-expanded if
 necessary, in the case of a data family instance. (If it's a type
 family instance, `etaExpandFamInstLHS` just returns the supplied type
 variables and LHS types unchanged).

 Along the way, I noticed that many references to
 `Note [Eta reduction for data families]` (in `FamInstEnv`) had
 slightly bitrotted (they either referred to a somewhat different
 name, or claimed that the Note lived in a different module), so
 I took the liberty of cleaning those up.

 Test Plan: make test TEST="T9692 T15845"

 Reviewers: goldfire, bgamari

 Reviewed By: goldfire

 Subscribers: rwbarton, carter

 GHC Trac Issues: #15845

 Differential Revision: https://phabricator.haskell.org/D5294
 }}}

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


More information about the ghc-tickets mailing list