
No magic coercing is present in the proposal. You need to use explicit newtype wrap and newtype unwrap expressions.
Sent from my iPad
On Jan 14, 2013, at 6:42 PM, Johan Tibell
On Mon, Jan 14, 2013 at 3:40 PM, Evan Laforge
wrote: Wait, what's the runtime error? Do you mean messing up Set's invariants?
Yes.
If you as the library writer don't want to allow unsafe things, then don't export the constructor. Then no one can break your invariants, even with newtype malarky. If you as the the library user go and explicitly import the bare Set constructor from (theoretical) Data.Set.Unsafe, then you are in the position to break Set's internal invariants anyway, and have already accepted the great power / great responsibility tradeoff.
If it's explicit that this is what you're doing I'm fine with it. I just don't want magic coercing depending on what's in scope.
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users