[GHC] #8745: GeneralizedNewtypeDeriving is still not Safe

GHC ghc-devs at haskell.org
Tue Feb 11 20:29:12 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
      Resolution:                    |         Keywords:  Safe
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by goldfire):

 The comments I've seen in relation to this are all in #5498.

 GND is now actually built on top of `coerce`, so I think it's a little
 incongruent to have one be Safe but not the other.

 To be fair, I'm not 100% sure that GND should be Safe, myself. While I am
 as confident as I can be about its type safety, it is very easy to imagine
 a library author omitting a key role annotation that would allow clients
 to (perhaps unwittingly) break class coherence or invariants. For example,
 if `base`'s `Set` doesn't have a role annotation, it would be very easy to
 cause the `Set` operations to misbehave.

 Simon PJ has advocated (see #5498) that GND should be Safe, on the other
 hand.

 My goal in creating this ticket is to make a reasoned decision on the
 matter, as opposed to letting inertia make the decision for us.

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


More information about the ghc-tickets mailing list