<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 2, 2015 at 2:38 AM, Bertram Felgenhauer <span dir="ltr"><<a href="mailto:bertram.felgenhauer@googlemail.com" target="_blank">bertram.felgenhauer@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Michael,<br>
<span class=""><br>
> Being able to get all the packages that have a particular name sounds<br>
> good!  Note that if "-hide-package" / "-hide-all-packages" is used, I<br>
> wouldn't want those packages in the results.<br>
<br>
</span>Same here.<br>
<span class=""><br>
> Like Dan, I'm a little less keen on #1.  Here's why:<br>
><br>
</span>[...]<br>
<span class="">><br>
> * I couldn't find any examples of its usage that would be broken by this<br>
> new semantics.  I've done a search on github[1] to find usages of PkgName,<br>
> and I only found one use[2] that uses PkgName which would be affected by<br>
> this change.  This example is in the TH lib itself, and so would hopefully<br>
> be fixed by this change.<br>
<br>
</span>Did you find any uses where an existing PkgName is reused to construct<br>
a new name? I believe this would be an important data point for deciding<br>
whether renaming the constructor is a good idea or not. Basically I'm<br>
asking whether the majority of uses of PkgName "out in the wild" right<br>
now is correct or incorrect.<br></blockquote><div><br>I didn't search for that, since I was searching for explicit uses of PkgName.  The results for NameG are pretty interesting, though:</div><div><br></div><div><a href="https://github.com/search?l=haskell&q=NameG&type=Code&utf8=%E2%9C%93">https://github.com/search?l=haskell&q=NameG&type=Code&utf8=%E2%9C%93</a></div><div><br></div><div>It seems like most of the results are either `Lift`ing a PkgName or re-using a PkgName from another name.  However, there are a fair number of uses which explicitly construct the name, though.  In particular, there are a fair number of usages of this to generate references to the tuple constructors in GHC.Prim.</div><div><br></div><div>Interestingly, these usages of (mkPkgName "ghc-prim") don't have version numbers at all.  This implies that the behavior is to select the version of the package which is currently being used.</div><div><br></div><div>Considering how much more convenient this is than manually looking up package names, I'm strongly in favor of keeping PkgName and its current behavior, and extending it to handle package keys.  Ideally, also documenting the different formats it expects.  In particular, "name", "name-version", and "name-version-key" (I'm guessing).</div><div><br></div><div>The issue here is that we may be linking against two different packages which are named the same thing, right?  This was always a possibility, and having package keys just makes it so that we need the ability to disambiguate packages beyond version numbers.</div><div><br></div><div>So, how about for this rare-ish case where there we're linking against two different versions of the foo package, and the TH manually generates a (PkgName "foo"), we generate an ambiguity error.</div><div><br></div><div>If we force users to search for and specify fully unambiguous package names then that pushes the boilerplate of package selection out to TH usage.  It seems like pretty much everyone will want "select the version of the package that I'm using."  That said, I'm also in favor of adding the function mentioned in #2, for those cases where the default isn't sufficient (I'm anticipating very few of these).</div><div><br></div><div>-Michael</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Cheers,<br>
<br>
Bertram<br>
<div class=""><div class="h5">_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div>