containers: intersections for Set, along with Semigroup newtype

David Feuer david.feuer at gmail.com
Mon Dec 7 08:50:05 UTC 2020


That implementation doesn't short-circuit if the accumulator goes empty. It
also relies on the optimizer to accumulate strictly.

On Mon, Dec 7, 2020, 3:44 AM Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Sun, 6 Dec 2020, Reed Mullanix wrote:
>
> > In a perfect world we would use something like Foldable1 from
> > semigroupoids, but sadly that is not in base.
>
> Is it necessary to have it in base for your use? For me, 'NonEmpty.foldl1
> Set.intersection' is perfect.
> _______________________________________________
> 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/20201207/7c84d716/attachment.html>


More information about the Libraries mailing list