[GHC] #8984: Improve output of failed GeneralizedNewtypeDeriving coercion due to type roles

GHC ghc-devs at haskell.org
Tue Dec 2 20:25:36 UTC 2014


#8984: Improve output of failed GeneralizedNewtypeDeriving coercion due to type
roles
-------------------------------------+-------------------------------------
              Reporter:  haasn       |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.1
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 With my update to the solver (preview available at
 http://github.com/goldfirere/ghc, `wip/rae-new-coercible` branch), the new
 error message is thus:

 {{{
 T8984.hs:7:46:
     Couldn't match representation of type ‘cat a (N cat a Int)’
                              with that of ‘cat a (cat a Int)’
     arising from the coercion of the method ‘app’
       from type ‘cat a (cat a Int)’ to type ‘N cat a (N cat a Int)’
     Relevant role signatures:
       type role N representational nominal nominal
     NB: We cannot know what roles the parameters to ‘cat a’ have;
       we must assume that the role is nominal
     When deriving the instance for (C (N cat a))
 }}}

 I like it, and will close this ticket when I merge.

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


More information about the ghc-tickets mailing list