<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Given the open world assumption, how do you know a priori if a type is declared at greater scope?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">(Note: one answer here is that you can refuse to link in such a contradictory instance, so instead of an ‘open world’ you move to a ‘coherent world’ where you have to discharge a global coherence constraint check at compile time — I never fully fleshed this out, but I think it might open a number of interesting possibilities).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">(Also — I just realized this is in the wrong location — the haskell-prime list. Proposals like this that do not exist yet in any compiler tend to be out of scope for the prime process, such as it exists. It would be better to produce a sketch and ask for feedback in a different venue — perhaps glasgow-haskell-users, and if you reach a point where you have a full spec then you can submit it through the ghc proposals process.)</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">-g</div> <br> <div id="bloop_sign_1525048137945063168" class="bloop_sign"></div> <br><p class="airmail_on">On April 29, 2018 at 7:37:30 PM, Matthew Farkas-Dyck (<a href="mailto:strake888@gmail.com">strake888@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>On 4/29/18, Edward Kmett <ekmett@gmail.com> wrote:<br>> This isn't sound.<br>><br>> You lose the global uniqueness of instance resolution, which is a key part<br>> of how libraries like Data.Set and Data.Map move the constraints from being<br>> carried around in the Set to the actual use sites. With "local" instances it<br>> is very easy to construct such a map in one local context and use it in<br>> another with a different instance.<br><br>Ah, i forgot to say explicitly: local instances of types declared at<br>greater scope are not allowed. Is it unsound nonetheless?<br>_______________________________________________<br>Haskell-prime mailing list<br>Haskell-prime@haskell.org<br>http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-prime<br></div></div></span></blockquote></body></html>