Re: Faster `elem` "Hack" for Data.Set?
David Feuer <[email protected]> Sun, 30 Jan 2022 00:19:46 -0500
| Newsgroups | gmane.comp.lang.haskell.libraries |
|---|---|
| Message-ID | <CAMgWh9uczo0C8Q-wTFOE=2O+TmuWw5wB2J31oKOaXZDFe801uQ@mail.gmail.com> |
--===============8979059260092845346== Content-Type: multipart/alternative; boundary="000000000000b5944805d6c5d171" --000000000000b5944805d6c5d171 Content-Type: text/plain; charset="UTF-8" MonoFoldable isn't the answer either. That also has the problem of requiring the same constraint for folding as for membership tests. On Sun, Jan 30, 2022, 12:12 AM PHO <[email protected]> wrote: > On 1/30/22 9:59 AM, David Feuer wrote: > [snip] > > . I think the real answer is to remove `elem` from `Foldable` and put > > it somewhere more appropriate. > > In a separate class? That would only help `elem` but not any other > methods of Foldable. I'd rather love to see MonoFoldable[1] to be moved > to base then. > > [1]: > > https://hackage.haskell.org/package/mono-traversable-1.0.15.3/docs/Data-MonoTraversable.html#t:MonoFoldable > _______________________________________________ > Libraries mailing list > [email protected] > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries > --000000000000b5944805d6c5d171 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div>MonoFoldable isn't the answer either. That also = has the problem of requiring the same constraint for folding as for members= hip tests.<br><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmai= l_attr">On Sun, Jan 30, 2022, 12:12 AM PHO <<a href=3D"mailto:pho@cielon= egro.org" target=3D"_blank" rel=3D"noreferrer">[email protected]</a>> w= rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex= ;border-left:1px #ccc solid;padding-left:1ex">On 1/30/22 9:59 AM, David Feu= er wrote:<br> [snip]<br> > . I think the real answer is to remove `elem` from `Foldable` and put<= br> > it somewhere more appropriate.<br> <br> In a separate class? That would only help `elem` but not any other <br> methods of Foldable. I'd rather love to see MonoFoldable[1] to be moved= <br> to base then.<br> <br> [1]: <br> <a href=3D"https://hackage.haskell.org/package/mono-traversable-1.0.15.3/do= cs/Data-MonoTraversable.html#t:MonoFoldable" rel=3D"noreferrer noreferrer n= oreferrer" target=3D"_blank">https://hackage.haskell.org/package/mono-trave= rsable-1.0.15.3/docs/Data-MonoTraversable.html#t:MonoFoldable</a><br> _______________________________________________<br> Libraries mailing list<br> <a href=3D"mailto:[email protected]" rel=3D"noreferrer noreferrer" targ= et=3D"_blank">[email protected]</a><br> <a href=3D"http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel= =3D"noreferrer noreferrer noreferrer" target=3D"_blank">http://mail.haskell= .org/cgi-bin/mailman/listinfo/libraries</a><br> </blockquote></div></div></div> --000000000000b5944805d6c5d171-- --===============8979059260092845346== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTGlicmFyaWVz IG1haWxpbmcgbGlzdApMaWJyYXJpZXNAaGFza2VsbC5vcmcKaHR0cDovL21haWwuaGFza2VsbC5v cmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2xpYnJhcmllcwo= --===============8979059260092845346==--