[GHC] #13598: role annotation for newtype (partially?) ignored?

GHC ghc-devs at haskell.org
Thu Apr 20 14:55:13 UTC 2017


#13598: role annotation for newtype (partially?) ignored?
-------------------------------------+-------------------------------------
        Reporter:  edsko             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Role annotations on newtypes are less interesting when the newtype
 constructor is in scope. In your case, GHC reduces `Coercible (C a) Int`
 to `Coercible o Int` and away it goes.

 And indeed if you hide the `MkC` constructor (via the usual import/export
 mechanism), `fooC` fails because of ambiguity.

 I do see how this is potentially confusing, however. A concrete suggestion
 for improvement in documentation is always welcome.

 If you agree with my analysis, please close the ticket. Thanks!

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


More information about the ghc-tickets mailing list