Proposal: Add singleton function to Data.List module

Bertram Felgenhauer bertram.felgenhauer at googlemail.com
Tue Aug 20 10:47:29 UTC 2019


Taylor Fausak wrote:
> It has been a week since I submitted my proposal. During that time, 28
> people voted, with 16 expressing approval and 12 expressing
> disapproval. To everyone that voted so far: Thank you! You made for
> interesting discussion.

I've just written about straw polls in a separate mail...

In the particular case of adding `singleton` to `Data.List`, I don't
believe having `singleton` in Data.List will cause much harm beyond
being yet another synonym to remember when reading other people's code,
and inevitably breaking some code. I can even see the consistency
argument, if one views lists as containers. But to me, lists are,
foremost, iterators. (In fact that's why I usually import Data.List
unqualified, because iterators are so common! So the risk of breaking
code is, to me, real.)

I'm pretty sure I will not use `singleton`, having grown used to all
four of (:[]), \x -> [x], `return`, and lately `pure`. So there's no
benefit in having the function.

(If you're counting votes, that's -1 from me.)

Cheers,

Bertram


More information about the Libraries mailing list