
The reason it's not safe in Safe Haskell is precisely #1496, the newtpye deriving bug. Now that's fixed, Safe Haskell can remove the safety check. Probably.
This is another question that could usefully be articulated on the design page, Joachim.
Simon
| -----Original Message-----
| From: Richard Eisenberg [mailto:eir@cis.upenn.edu]
| Sent: 07 September 2013 18:46
| To: Simon Peyton-Jones
| Cc: Joachim Breitner; ghc-devs@haskell.org
| Subject: Re: newtype coercion wrapping status
|
| OK -- thanks for clarifying. This all sits better with me.
|
| But, I'm still a little concerned about the "Safe Haskell" implications.
| My understanding is that allowing coercions when the constructor is not
| exported will not be considered "Safe". Here's a way forward:
|
| Currently: a type is considered abstract when its constructors are not
| exported.
|
| Future proposal: a type is considered abstract when its constructors are
| not exported AND its type parameters are all at role Nominal.
|
| Under this new definition of "abstract", a library writer that remembers
| not to export a constructor but neglects to use a role annotation should
| consider a type *not* to be abstract. Is this what we want?
|
| Richard
|
| On Sep 7, 2013, at 1:16 PM, Simon Peyton-Jones