
On Mon, Jan 14, 2013 at 5:29 PM, Johan Tibell
Let me rephrase: how will Simon's proposed "data constructors are in scope" mechanism work? For example, will
let xs :: Map = ... in map MyNewtype xs
behave differently if the constructors of Map are in scope or not?
If you allow deriving this without the constructors in scope, the user can use it to violate the invariant (by the new type causing Map to think it is sorted differently than it is, because there is a different Ord constraint). Requiring the constructors to be in scope doesn't actually prevent this, but does give the user some chance to do something about it. Meanwhile something that deliberately hides its constructors to preserve an invariant can't suddenly have that invariant violated by an errant use of this feature. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net