generalize type of Data.Set.unions from List to Foldable

David Feuer david.feuer at gmail.com
Sun Feb 4 20:21:31 UTC 2018


We shouldn't remove it because of fold. We should (perhaps) remove it
because of foldl'. I don't really think unions or unionsWith should
ever have existed. I certainly don't think we should remove union,
because Set offers more than one reasonable Semigroup; <> isn't a very
clear spelling of union.

On Sun, Feb 4, 2018 at 3:09 PM, Joachim Breitner
<mail at joachim-breitner.de> wrote:
> Hi,
>
> Am Samstag, den 03.02.2018, 20:44 -0500 schrieb David Feuer:
>> It is fold, although fold is not so great for lists in this context. It's also foldl' union Set.empty, which is better for lists, and probably also for balanced trees. I initially thought that we should surely generalize, but now another alternative comes to mind: remove. As a containers maintainer, I believe we should either:
>>
>> 1. Generalize as proposed, or
>> 2. Deprecate and remove.
>>
>> I'm currently somewhat in favor of the second option.
>
> please don’t remove!
>
> …is first reaction. Now I just have to rationalize my gut feeling…
>
> I like the readability of it in code, it is more descriptive. It is an
> important analogue to unionsWith. If we remove unions because of fold,
> shouldn’t we also remove union because of (<>)?
>
>
> Cheers,
> Joachim
>
> --
> Joachim Breitner
>   mail at joachim-breitner.de
>   http://www.joachim-breitner.de/
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


More information about the Libraries mailing list