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

David Feuer david.feuer at gmail.com
Sun Feb 4 01:44:44 UTC 2018


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.

On Feb 3, 2018 9:42 AM, "Henning Thielemann" <lemming at henning-thielemann.de>
wrote:


On Sat, 3 Feb 2018, Johannes Waldmann wrote:

I propose this change for containers:
>
> have:  unions ::               [ Set a ] -> Set a
> want:  unions :: Foldable f => f (Set a) -> Set a
>

That's Foldable.fold.

_______________________________________________
Libraries mailing list
Libraries at haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20180203/8951bdaf/attachment.html>


More information about the Libraries mailing list