[GHC] #8827: Inferring Safe mode with GeneralizedNewtypeDeriving is wrong

GHC ghc-devs at haskell.org
Mon Mar 24 10:46:38 UTC 2014


#8827: Inferring Safe mode with GeneralizedNewtypeDeriving is wrong
-------------------------------------+------------------------------------
        Reporter:  goldfire          |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:  7.10.1
       Component:  Compiler          |          Version:  7.9
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:  8226, 8745
-------------------------------------+------------------------------------

Comment (by simonpj):

 OK, so we've essentially decided (for 7.8)
  * Keep the status quo (as presented in the paper) for 7.8
  * But GND and `Data.Coerce` are both out of bounds for Safe Haskell

 That's ok with me.  Subsequent to 7.8, the Davids (or other Safe Haskell
 folk) may want to propose a concrete plan for getting them back in.  Or
 maybe it just doesn't matter because Safe Haskell clients don't care
 (enough) about GND or `Coercible`.

 FWIW I am keen to avoid any solution based on direct user control of
 `Coercible` instances.   We have roles (we need them regardless to
 guarantee type-soundness); what we want can be expressed through roles or
 role signatures; adding ''another'' mechanism of control that does almost
 the same thing should be avoided if at all possible.

 Indeed, I don't think in terms of instance declarations for `Coercible` at
 all; instead it's just a matter of what rules are available for solving
 `Coercible` constraints.  To take an analogy, implicit parameters are
 internally implemented as type-class constraints, with some special rules.
 They share some stuff in common with type class constraints, but are best
 thought of separately. Same with `Coercible`.

 Simon

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


More information about the ghc-tickets mailing list