<div class="gmail_quote">On Wed, Jun 3, 2009 at 3:33 AM, Ashley Yakeley <span dir="ltr">&lt;<a href="mailto:ashley@semantic.org">ashley@semantic.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">wren ng thornton wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yeah, orphan instances are bad.<br>
</blockquote>
<br></div>
Why?<br>
<br>
I already use private orphan modules within the package, though the package does not externally expose any orphan instances.<div class="im"></div></blockquote><div><br></div><div>They are fine if they aren&#39;t exposed, right up until the package with their definition decides to provide the instance themselves, at which point your orphan violates encapsulation. It is of course worse if they are exposed then you can wind up with incoherent dictionaries floating around for the same type.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;m with Edward Kmett here, for the time package, having compiler-dependent instances seems like the least evil. (For other packages, it depends on the classes and on how easy it would be to avoid the problem.)<br>
</blockquote>
<br></div>
The downside is that the package has to know, and fossilize, information about compilers. Though I will go this way if orphan instances are shown to be sufficiently problematic.<br></blockquote><div><br></div><div>That said, the only knowledge it is fossilizing is the existence of a single language feature, DeriveDataTypeable or Rank2Types. On further reflection, using Rank2Types is probably a better way to go than DeriveDataTypeable, if somewhat more effort, if only because Hugs can support the former, but not the latter.</div>
<div> </div><div>-Edward Kmett</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
-- <br><font color="#888888">
Ashley</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br>