Proposal: Add singleton function to Data.List module

Sven Panne svenpanne at gmail.com
Wed Aug 14 19:51:15 UTC 2019


Am Mi., 14. Aug. 2019 um 21:35 Uhr schrieb Oliver Charles <
ollie at ocharles.org.uk>:

> I'd also be interested in a kind of "reverse" argument - *if* we had this
> added, what are the costs? There are arguments of "no, pure/robot ninja is
> enough" - fine, we're not taking those away so you aren't required to use
> singleton  But what is the *downside* of having singleton? [...]
>

A similar argument comes up with basically every extension, and it is a
very weak one. Code is mainly *read*, not written, so the less you need to
know to read and understand code, the better it is. Lots of different ways
to do the same thing makes programs harder to understand, and you
ultimately end up with Perl. :-}  And if we take this argument seriously,
we should probably add "doubleton" (synonym for "replicate 2"), "tripleton"
(synonym for "replicate 3"), etc., too.  Hey, you don't have to use it
after all, we're not taking away "replicate"...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190814/9559201a/attachment.html>


More information about the Libraries mailing list