[GHC] #2850: GeneralizedNewtypeDeriving + TypeFamilies doesn't work

GHC ghc-devs at haskell.org
Thu Nov 21 09:36:45 UTC 2013


#2850: GeneralizedNewtypeDeriving + TypeFamilies doesn't work
-------------------------------------------------+-------------------------
        Reporter:  ajd                           |            Owner:
            Type:  feature request               |           Status:
        Priority:  normal                        |  closed
       Component:  Compiler                      |        Milestone:  6.12
      Resolution:  fixed                         |  branch
Operating System:  Unknown/Multiple              |          Version:
 Type of failure:  None/Unknown                  |  6.10.1
       Test Case:                                |         Keywords:
  indexed_types/should_compile/T2850             |     Architecture:
        Blocking:                                |  Unknown/Multiple
                                                 |       Difficulty:
                                                 |  Unknown
                                                 |       Blocked By:
                                                 |  Related Tickets:
-------------------------------------------------+-------------------------
Changes (by nomeata):

 * failure:   => None/Unknown


Comment:

 If we implement GND via `Coercible`, this will no longer work: Coercing
 `bar :: B Bool -> B Bool` to the instance for `Int` will print

 {{{
       No instance for (GHC.Types.Coercible (B Bool) (B Int))
       because the first type argument of ‛B’ has role Nominal,
       but the arguments ‛Bool’ and ‛Int’ differ
       arising from a use of ‛GHC.Prim.coerce’
 }}}

 Richard, as the expert on roles, is that avoidable?

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


More information about the ghc-tickets mailing list