Re: Faster `elem` "Hack" for Data.Set?

Keith <[email protected]> Sun, 30 Jan 2022 14:30:53 +0000
Newsgroups gmane.comp.lang.haskell.libraries
Message-ID <[email protected]>
--===============5220348039342477645==
Content-Type: multipart/alternative;
 boundary=----EOTWG860NYDRD1GF521YUWE29R12OO
Content-Transfer-Encoding: 7bit

------EOTWG860NYDRD1GF521YUWE29R12OO
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

I haven't found a downside to requiring that the elements of sets be `Ord` =
to be `MonoFoldable`=2E Yes, the dictionary is ignored by all the generic m=
ethods, but you still needed it to construct the `Set`=2E=20
`MonoFoldable` includes some questionable design choices, but the `Ord` re=
quirement for `Set` is not one=2E

Sent from my phone with K-9 Mail=2E

On 30 January 2022 05:19:46 UTC, David Feuer <david=2Efeuer@gmail=2Ecom> w=
rote:
>MonoFoldable isn't the answer either=2E That also has the problem of
>requiring the same constraint for folding as for membership tests=2E
>
>On Sun, Jan 30, 2022, 12:12 AM PHO <pho@cielonegro=2Eorg> wrote:
>
>> On 1/30/22 9:59 AM, David Feuer wrote:
>> [snip]
>> > =2E I think the real answer is to remove `elem` from `Foldable` and p=
ut
>> > it somewhere more appropriate=2E
>>
>> In a separate class? That would only help `elem` but not any other
>> methods of Foldable=2E I'd rather love to see MonoFoldable[1] to be mov=
ed
>> to base then=2E
>>
>> [1]:
>>
>> https://hackage=2Ehaskell=2Eorg/package/mono-traversable-1=2E0=2E15=2E3=
/docs/Data-MonoTraversable=2Ehtml#t:MonoFoldable
>> _______________________________________________
>> Libraries mailing list
>> Libraries@haskell=2Eorg
>> http://mail=2Ehaskell=2Eorg/cgi-bin/mailman/listinfo/libraries
>>

------EOTWG860NYDRD1GF521YUWE29R12OO
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body>I haven't found a downside to requiring that the e=
lements of sets be `Ord` to be `MonoFoldable`=2E Yes, the dictionary is ign=
ored by all the generic methods, but you still needed it to construct the `=
Set`=2E <br>`MonoFoldable` includes some questionable design choices, but t=
he `Ord` requirement for `Set` is not one=2E<div style=3D'white-space: pre-=
wrap'><br>Sent from my phone with K-9 Mail=2E</div><br><br><div class=3D"gm=
ail_quote">On 30 January 2022 05:19:46 UTC, David Feuer &lt;david=2Efeuer@g=
mail=2Ecom&gt; wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0pt=
 0pt 0pt 0=2E8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: =
1ex;">
<div dir=3D"auto"><div>MonoFoldable isn't the answer either=2E That also h=
as the problem of requiring the same constraint for folding as for membersh=
ip tests=2E<br><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gma=
il_attr">On Sun, Jan 30, 2022, 12:12 AM PHO &lt;<a href=3D"mailto:pho@cielo=
negro=2Eorg" target=3D"_blank" rel=3D"noreferrer">pho@cielonegro=2Eorg</a>&=
gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 =2E8ex;border-left:1px #ccc solid;padding-left:1ex">On 1/30/22 9:59 AM, Da=
vid Feuer wrote:<br>
[snip]<br>
&gt; =2E I think the real answer is to remove `elem` from `Foldable` and p=
ut<br>
&gt; it somewhere more appropriate=2E<br>
<br>
In a separate class? That would only help `elem` but not any other <br>
methods of Foldable=2E I'd rather love to see MonoFoldable[1] to be moved =
<br>
to base then=2E<br>
<br>
[1]: <br>
<a href=3D"https://hackage=2Ehaskell=2Eorg/package/mono-traversable-1=2E0=
=2E15=2E3/docs/Data-MonoTraversable=2Ehtml#t:MonoFoldable" rel=3D"noreferre=
r noreferrer noreferrer" target=3D"_blank">https://hackage=2Ehaskell=2Eorg/=
package/mono-traversable-1=2E0=2E15=2E3/docs/Data-MonoTraversable=2Ehtml#t:=
MonoFoldable</a><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href=3D"mailto:Libraries@haskell=2Eorg" rel=3D"noreferrer noreferrer" t=
arget=3D"_blank">Libraries@haskell=2Eorg</a><br>
<a href=3D"http://mail=2Ehaskell=2Eorg/cgi-bin/mailman/listinfo/libraries"=
 rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">http://mail=2Eh=
askell=2Eorg/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div></div>
</blockquote></div></body></html>
------EOTWG860NYDRD1GF521YUWE29R12OO--

--===============5220348039342477645==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTGlicmFyaWVz
IG1haWxpbmcgbGlzdApMaWJyYXJpZXNAaGFza2VsbC5vcmcKaHR0cDovL21haWwuaGFza2VsbC5v
cmcvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2xpYnJhcmllcwo=

--===============5220348039342477645==--