<div dir="ltr"><div><div>> Why not defining a class in xml-conduit then?<br><br>This is hardly something that affects just one or two packages.<br><br><a href="http://packdeps.haskellers.com/reverse/data-default" target="_blank">http://packdeps.haskellers.com/reverse/data-default</a><br>
<br></div>There seems to be 232 packages using Data-Default.<br><br></div>Cheers<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-21 19:46 GMT+01:00 Michael Snoyman <span dir="ltr"><<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I honestly don't feel very strongly about usage of Default. What I've found it useful for is a very narrow category: a function which takes a configuration parameter that users likely never want to modify. For example: xml-conduit has various parsing and rendering settings, but most use cases are good with the default. There's a cognitive overhead for a user to remember the default parameter name (is it defaultXMLSettings? defaultXmlSettings? defParseSettings?).<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 7:11 PM, Adam Bergmark <span dir="ltr"><<a href="mailto:adam@bergmark.nl" target="_blank">adam@bergmark.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">As is, I don't find data-default to be useful, and decided to move away from it in fay for a number of reasons:<div>
<br></div><div>* You cannot add arguments to it because of the existing <a href="http://hackage.haskell.org/package/data-default-0.5.3/docs/Data-Default.html#t:Default" style="font-size:12.800000190734863px;margin:0px;padding:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;line-height:16.119998931884766px;white-space:nowrap" target="_blank">Default</a><span style="font-size:12.800000190734863px;color:rgb(0,0,0);font-family:monospace;line-height:16.119998931884766px;white-space:nowrap;background-color:rgb(240,240,240)"> r => </span><a href="http://hackage.haskell.org/package/data-default-0.5.3/docs/Data-Default.html#t:Default" style="font-size:12.800000190734863px;margin:0px;padding:0px;text-decoration:none;color:rgb(171,105,84);font-family:monospace;line-height:16.119998931884766px;white-space:nowrap" target="_blank">Default</a><span style="font-size:12.800000190734863px;color:rgb(0,0,0);font-family:monospace;line-height:16.119998931884766px;white-space:nowrap;background-color:rgb(240,240,240)"> (e -> r) </span> instance or run it in e.g. IO (via Chris Done)</div>
<div>* The previous point means it's likely you'll have to scrap your instance at some point instead of just changing a type</div><div>* You need to either re-export def or users need to depend on data-default themselves. Even if it was in base (but not in Prelude) they would need to add an additional import</div>
<div>* The semantics needs to be defined for each instance</div><div>* I don't see any use case for abstracting over different instances of Default</div><div>* I think it's useful to be explicit about the "default" value you are using. I'm unlikely to use `def' over `Set.empty'. Code is read more often than it's written.</div>
<div><br></div><div>I think Empty sounds like a better name. Some things have a clear "empty" value that will never change. I don't object strongly to using Empty/Default for these.</div><div><br></div></div>
<div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 5:37 PM, João Cristóvão <span dir="ltr"><<a href="mailto:jmacristovao@gmail.com" target="_blank">jmacristovao@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I stand corrected, he actually posted something on github this month.<br><br>Lucas, what would you think about merging generics support into Data.Default?<br>
<br></div>João<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-05-21 16:31 GMT+01:00 João Cristóvão <span dir="ltr"><<a href="mailto:jmacristovao@gmail.com" target="_blank">jmacristovao@gmail.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div><div><div>I definitely see your point, and have suffered that myself, of course.<br><br></div>I just guess I did not want to get with the trouble of taking ownership of a package, after trying to contact Lucas Mai on February this year, with no response.<br>
</div>His github repository shows no activity since October last year.<br><a href="https://github.com/mauke" target="_blank">https://github.com/mauke</a><br><br></div>But I do guess it is the right thing to do: if anyone knows Lucas and can contact him, to see if he stills wishes to maintain the package, I would very much appreciate that (I've also included the .cabal listed email in this conversation).<br>
</div>If he is not interested or does not respond within a reasonable time frame, I propose myself as maintainer of the package (and will gladly accept suggestions).<br><br></div>Cheers<br></div>João<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-05-21 16:18 GMT+01:00 Michael Snoyman <span dir="ltr"><<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Starting a new thread to continuing discussing this (I should have done so in the first place).<br><br></div>Here's the problem: a class like Default is most useful if everyone's using the same class. The reason is that multiple libraries are all free to reexport the `def` symbol, and they'll all refer to the same identifier. If multiple `def`s exist, then this doesn't work, you need to be careful about *which* `def` you're using, and you may as well just export a default value under its own unique name.<br>
<br></div>I think data-default-generics is overall an improvement on data-default, but the very nature of a fork here makes both packages less useful. I'd much rather that data-default simply merged in data-default-generics.<br>
<div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 6:12 PM, João Cristóvão <span dir="ltr"><<a href="mailto:jmacristovao@gmail.com" target="_blank">jmacristovao@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Sorry for continuing the off-topic, and for promoting a package of mine:<br><br></div>If you only need the class definition, <a href="http://hackage.haskell.org/package/data-default-class" target="_blank">http://hackage.haskell.org/package/data-default-class</a> is a better choice, with no dependencies.<br>
<br></div>If you prefer a single package with all the dependencies (and with additional generics support), my own fork might be useful:<br><a href="http://hackage.haskell.org/package/data-default-generics" target="_blank">http://hackage.haskell.org/package/data-default-generics</a><br>
<br></div><div>Although I mirrored the original package dependencies, many of which might actually be unnecessary... (given the generics implementation).<br></div><div><br></div>Cheers<br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">2014-05-21 15:59 GMT+01:00 Michael Snoyman <span dir="ltr"><<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>></span>:<div><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">At the risk of veering terribly off-topic... the splitting of data-default into all of those packages caused me a bunch of dependency headaches, most of which I still don't fully comprehend. I miss the good ol' days of a single package.<br>
</div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 21, 2014 at 5:53 PM, Edward Kmett <span dir="ltr"><<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I find myself rather hesitant to recommend that instantiation of the idea ever since it exploded into a half-dozen packages full of orphan instances, but yes.<span><font color="#888888"><div>
<br></div><div>-Edward</div></font></span></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 21, 2014 at 6:38 AM, Herbert Valerio Riedel <span dir="ltr"><<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On 2014-05-21 at 00:23:44 +0200, Andreas Abel wrote:<br>
>>> _Lots_ of users initialize empty maps with mempty<br>
><br>
> Well, this is another issue, empty should be overloaded via<br>
><br>
> class Empty a where<br>
> empty :: a<br>
<br>
</div>Btw, isn't this what<br>
<br>
<a href="http://hackage.haskell.org/package/data-default" target="_blank">http://hackage.haskell.org/package/data-default</a><br>
<br>
provides?<br>
<div><div>_______________________________________________<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></div>
</div></div><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>
<br></blockquote></div><br></div>
</div></div><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>
<br></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div></div></div><br></div>
</blockquote></div></div></div><br></div>
<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>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>