newtype coercion wrapping status

Joachim Breitner mail at
Tue Sep 10 16:48:43 CEST 2013


Am Montag, den 09.09.2013, 13:25 -0400 schrieb Richard Eisenberg:
> According to the original post and the comments on #5498
> (, breaking through
> abstraction is another reason for keeping GND outside of Safe Haskell.
> I'm worried that the same concern would affect newtype coercions given
> the current proposal.

an easy fix would be to disallow coerce in Safe Haskell.

A similarly easy fix would be to add the requirements that constructors
have to be in scope when generating the
        instance Coercible a b => Coercible (D a) (D b)
rule in Safe Haskell code. Although that might cripple the feature too
much, but not more than not having the feature at all.

I think the latter is a good compromise for the non-advertised release.


Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  Jabber: nomeata at  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the ghc-devs mailing list