<div dir="ltr">Let me give you an example from xmonad. A good configuration system would let me, building a config, use it to set local defaults, like a variant of greenXPConfig for all XMonad.Prompt uses. But I can't use `def` for this. As a user, this has only changed the value I use to build a separate configuration I still have to use --- and done so in a way prone to produce weird errors if I make a mistake.<div><br></div><div>Typeclasses are not flexible enough to provide a good solution here, and `def` ends up an annoyance instead of a help.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 8, 2018 at 5:39 AM, Marco Zocca <span dir="ltr"><<a href="mailto:zocca.marco@gmail.com" target="_blank">zocca.marco@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While I very much agree with all of you on the need for solid<br>
typeclass laws, I think Default still has its place in the library<br>
author toolkit .<br>
<br>
Think for example of configuration data for very flexible<br>
functionality such as plotting.<br>
<br>
On the other hand, if it's such a bad idea, what's a good course of<br>
action in this case ? Take over and deprecate ?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
On Tue, May 8, 2018 at 11:21 AM, Chris Wong <<a href="mailto:lambda.fairy@gmail.com">lambda.fairy@gmail.com</a>> wrote:<br>
> On Tue, May 8, 2018 at 9:10 PM, Marco Zocca <<a href="mailto:zocca.marco@gmail.com">zocca.marco@gmail.com</a>> wrote:<br>
>><br>
>> data-default alone is depended on by > 500 packages :<br>
>> <a href="http://packdeps.haskellers.com/reverse/data-default" rel="noreferrer" target="_blank">http://packdeps.haskellers.<wbr>com/reverse/data-default</a><br>
>><br>
>> Could you motivate why it's not a good idea ?<br>
>><br>
><br>
> I can think of two reasons:<br>
><br>
> - It has no laws, so there's formal specification that tells us whether an<br>
> instance is "correct" or not.<br>
><br>
> - Type classes are useful when there is a large family of generic operations<br>
> that can work with them. For example, the utility functions in Control.Monad<br>
> [1] are used in all kinds of Haskell programs. But there are no such generic<br>
> operations that apply to all Default instances.<br>
><br>
> That said -- as you note, it's has quite a few dependents so it's great that<br>
> someone is stepping up to maintain it regardless.<br>
><br>
> Chris<br>
><br>
> [1]<br>
> <a href="https://hackage.haskell.org/package/base-4.11.1.0/docs/Control-Monad.html#g:4" rel="noreferrer" target="_blank">https://hackage.haskell.org/<wbr>package/base-4.11.1.0/docs/<wbr>Control-Monad.html#g:4</a><br>
><br>
>><br>
>><br>
>> On Tue, May 8, 2018 at 11:02 AM, Christopher Allen <<a href="mailto:cma@bitemyapp.com">cma@bitemyapp.com</a>><br>
>> wrote:<br>
>> > Is this something folks still think is a good idea? I purge<br>
>> > Data.Default from projects I work on.<br>
>> ><br>
>> > On Tue, May 8, 2018 at 3:58 AM, Marco Zocca <<a href="mailto:zocca.marco@gmail.com">zocca.marco@gmail.com</a>><br>
>> > wrote:<br>
>> >> Dear all,<br>
>> >><br>
>> >>   I've been increasingly relying on data-default-class, but sadly it<br>
>> >> doesn't look like it's currently maintained; there are some tickets on<br>
>> >> the github issue tracker that would need some attention.<br>
>> >><br>
>> >> I have tried contacting the authro/current maintainer Lukas Mai (CC'd)<br>
>> >> by email but have not received an answer so far (I hope he's doing<br>
>> >> well, btw).<br>
>> >><br>
>> >> This is my first public request for taking over the `data-default`<br>
>> >> family of packages:<br>
>> >><br>
>> >> data-default-class<br>
>> >> data-default-instances-base<br>
>> >> data-default-instances-<wbr>containers<br>
>> >> data-default-instances-dlist<br>
>> >> data-default-instances-old-<wbr>locale<br>
>> >> data-default<br>
>> >><br>
>> >> Kind regards,<br>
>> >> Marco Zocca<br>
>> >> (<a href="http://hackage.haskell.org/user/ocramz" rel="noreferrer" target="_blank">http://hackage.haskell.org/<wbr>user/ocramz</a>)<br>
>> >> ______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Chris Allen<br>
>> > Currently working on <a href="http://haskellbook.com" rel="noreferrer" target="_blank">http://haskellbook.com</a><br>
>> ______________________________<wbr>_________________<br>
>> Haskell-Cafe mailing list<br>
>> To (un)subscribe, modify options or view archives go to:<br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
>> Only members subscribed via the mailman list are allowed to post.<br>
><br>
><br>
><br>
><br>
> --<br>
> Chris Wong (<a href="https://lambda.xyz" rel="noreferrer" target="_blank">https://lambda.xyz</a>)<br>
><br>
> "I had not the vaguest idea what this meant and when I could not remember<br>
> the words, my tutor threw the book at my head, which did not stimulate my<br>
> intellect in any way." -- Bertrand Russell<br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div>