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

GHC ghc-devs at haskell.org
Thu May 24 15:19:32 UTC 2018


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

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

 In [changeset:"979f085c4f87a93f48d6b567076d3c556d490fa8/ghc"
 979f085c/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="979f085c4f87a93f48d6b567076d3c556d490fa8"
 Clean up the conflicting data family instances error message

 Summary:
 The way we were pretty-printing conflicting data family
 instances in an error message was far from ideal:

 1. If a data type had no constructors, it would print an equals sign
    with nothing to the right of it.
 2. It would try to print GADTs using Haskell98 syntax.
 3. It eta-reduced away some type variables from the LHS.

 This patch addresses these three issues:

 1. We no longer print constructors at all in this error message.
    There's really no reason to do so in the first place, since
    duplicate data family instances always conflict, regardless of
    their constructors.
 2. Since we no longer print constructors, we no longer have to
    worry about whether we're using GADT or Haskell98 syntax.
 3. I've put in a fix to ensure that type variables are no longer
    eta-reduced away from the LHS.

 Test Plan: make test TEST=T14179

 Reviewers: goldfire, bgamari

 Reviewed By: bgamari

 Subscribers: rwbarton, thomie, carter

 GHC Trac Issues: #14179

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

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


More information about the ghc-tickets mailing list