Re: Add Data.Sequence.toList

chessai <[email protected]> Sat, 7 Mar 2026 19:01:39 -0800
Newsgroups gmane.comp.lang.haskell.libraries
Message-ID <CAD34_k+Rk7u7b+ba3Ri-_4Mwg_m4eDYq98Cd+rgqd+cA+i1oGA@mail.gmail.com>
--===============4469975764833656678==
Content-Type: multipart/alternative; boundary="000000000000de3cb6064c7a814f"

--000000000000de3cb6064c7a814f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I second this addition. Though I will note that there are potential
performance improvements to be had for a monomorphic version due to
specialisation and inlining - I typically prefer mononorphic toList when
available. This and API uniformity are sufficient motivations to me (even
just API uniformity alone).

Brandon, the libraries mailing list is archaic and mostly used now to
request package takeovers or for CLC elections. Back in 2020 it was still
used. I don't think posting here is necessary anymore (and it was almost
never productive).

Cheers,
chessai

On Sat, Mar 7, 2026, 3:56=E2=80=AFPM Brandon Chinn <[email protected]=
om>
wrote:

> My concern here isn't efficiency. Data.Sequence.toList should just be a
> reexport of Foldable.toList monomorphized to Seq. I just want a consisten=
t
> API with other modules in containers.
>
> I do see that Map.toList /=3D Foldable.toList. But Set.toList =3D=3D
> Foldable.toList, and it's not obvious to me why Set should have toList an=
d
> not Seq.
>
> On Sat, Mar 7, 2026, 3:37=E2=80=AFPM Dan Dart <[email protected]>=
 wrote:
>
>> Well, it's got a Foldable instance already, which gives you a toList for
>> anything Foldable, is it going to get any more efficientlythan this one?
>> That's one of the few reasons to add extra functions already covered by
>> type class instances, no?
>>
>> Cheers
>>
>> On Sat, 7 Mar 2026, 23:20 , <[email protected]> wrote:
>>
>>> An issue was opened on containers back in 2020 to add a monomorphic
>>> Data.Sequence.toList function:
>>> https://github.com/haskell/containers/issues/744. It was suggested to
>>> ask via the libraries list, and the previous reporter preferred to clos=
e
>>> the issue instead of continuing the process. I'm opening it back up:
>>> https://github.com/haskell/containers/issues/1184. Same motivation as
>>> the original issue; specifically, I always workaround this with
>>>
>>>     import Data.Foldable qualified as Seq (toList)
>>>     import Data.Sequence (Seq)
>>>     import Data.Sequence qualified as Seq
>>>
>>> It's odd that Data.Sequence doesn't provide toList when Map and Set do.
>>> Are there any objections to this?
>>>
>>> Best,
>>> Brandon Chinn
>>> _______________________________________________
>>> Libraries mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>>
>> _______________________________________________
> Libraries mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>

--000000000000de3cb6064c7a814f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>I second this addition. Though I will note that ther=
e are potential performance improvements to be had for a monomorphic versio=
n due to specialisation and inlining - I typically prefer mononorphic toLis=
t when available. This and API uniformity are sufficient motivations to me =
(even just API uniformity alone).</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">Brandon, the libraries mailing list is archaic and mostly used no=
w to request package takeovers or for CLC elections. Back in 2020 it was st=
ill used. I don&#39;t think posting here is necessary anymore (and it was a=
lmost never productive).</div><div dir=3D"auto"><br></div><div dir=3D"auto"=
>Cheers,</div><div dir=3D"auto">chessai<br><br><div class=3D"gmail_quote" d=
ir=3D"auto"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 7, 2026, 3:56=
=E2=80=AFPM Brandon Chinn &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank" rel=3D"noreferrer">[email protected]</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"auto">My concern her=
e isn&#39;t efficiency. Data.Sequence.toList should just be a reexport of F=
oldable.toList monomorphized to Seq. I just want a consistent API with othe=
r modules in containers.<div dir=3D"auto"><br></div><div dir=3D"auto">I do =
see that Map.toList /=3D Foldable.toList. But Set.toList =3D=3D Foldable.to=
List, and it&#39;s not obvious to me why Set should have toList and not Seq=
.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Sat, Mar 7, 2026, 3:37=E2=80=AFPM Dan Dart &lt;<a href=3D"mailto:=
[email protected]" rel=3D"noreferrer noreferrer" target=3D"_blank">=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"auto"><div>Well, it&#39;s got a Foldable instance already=
, which gives you a toList for anything Foldable, is it going to get any mo=
re efficientlythan this one? That&#39;s one of the few reasons to add extra=
 functions already covered by type class instances, no?</div><div><br></div=
><div dir=3D"auto">Cheers</div></div><br><div class=3D"gmail_quote"><div di=
r=3D"ltr" class=3D"gmail_attr">On Sat, 7 Mar 2026, 23:20 , &lt;<a href=3D"m=
ailto:[email protected]" rel=3D"noreferrer noreferrer noreferrer" t=
arget=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex">An issue was opened on containers back in 2020 to ad=
d a monomorphic Data.Sequence.toList function: <a href=3D"https://github.co=
m/haskell/containers/issues/744" rel=3D"noreferrer noreferrer noreferrer no=
referrer noreferrer" target=3D"_blank">https://github.com/haskell/container=
s/issues/744</a>. It was suggested to ask via the libraries list, and the p=
revious reporter preferred to close the issue instead of continuing the pro=
cess. I&#39;m opening it back up: <a href=3D"https://github.com/haskell/con=
tainers/issues/1184" rel=3D"noreferrer noreferrer noreferrer noreferrer nor=
eferrer" target=3D"_blank">https://github.com/haskell/containers/issues/118=
4</a>. Same motivation as the original issue; specifically, I always workar=
ound this with<br>
<br>
=C2=A0 =C2=A0 import Data.Foldable qualified as Seq (toList)<br>
=C2=A0 =C2=A0 import Data.Sequence (Seq)<br>
=C2=A0 =C2=A0 import Data.Sequence qualified as Seq<br>
<br>
It&#39;s odd that Data.Sequence doesn&#39;t provide toList when Map and Set=
 do. Are there any objections to this?<br>
<br>
Best,<br>
Brandon Chinn<br>
_______________________________________________<br>
Libraries mailing list -- <a href=3D"mailto:[email protected]" rel=3D"n=
oreferrer noreferrer noreferrer noreferrer" target=3D"_blank">libraries@has=
kell.org</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
rg" rel=3D"noreferrer noreferrer noreferrer noreferrer" target=3D"_blank">l=
[email protected]</a><br>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
Libraries mailing list -- <a href=3D"mailto:[email protected]" rel=3D"n=
oreferrer noreferrer" target=3D"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
rg" rel=3D"noreferrer noreferrer" target=3D"_blank">libraries-leave@haskell=
.org</a><br>
</blockquote></div></div></div>

--000000000000de3cb6064c7a814f--

--===============4469975764833656678==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Libraries mailing list -- [email protected]
To unsubscribe send an email to [email protected]

--===============4469975764833656678==--