[GHC] #8745: GeneralizedNewtypeDeriving is still not Safe

GHC ghc-devs at haskell.org
Fri Feb 7 04:12:05 UTC 2014


#8745: GeneralizedNewtypeDeriving is still not Safe
------------------------------------+-------------------------------------
       Reporter:  goldfire          |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.1-rc1
       Keywords:  Safe              |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 In GHC 7.8, !GeneralizedNewtypeDeriving (GND) is type-safe, due to the
 advent of roles. Although GND allows looking through unimported
 constructors, the notion of abstraction has changed -- for a type to be
 fully abstract in 7.8, it must not export its constructors, and the roles
 of all its parameters must be nominal. Thus, it would seem that GND should
 be Safe; that is, in the Safe Haskell subset. See also #5498.

 Currently, GND is not considered Safe.

 Along similar lines, the `Coercible` and `coerce` mechanism could be
 considered Safe, but there is no way to import these into a Safe module
 (they are in `GHC.Exts`).

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


More information about the ghc-tickets mailing list