Proposal: Add singleton function to Data.List module
Ignat Insarov
kindaro at gmail.com
Fri Aug 16 14:21:11 UTC 2019
I'd like to derail this conversation into remembering the "C, Unix hoax" joke.
https://www.gnu.org/fun/jokes/unix-hoax.html
> We stopped when we got a clean compile on the following syntax:
>
> for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("| "+(*u/4)%2);
We humans find it easier to think in words, which are singleton blobs
of sense requiring no parsing, no compilation, but immediately
obvious. The "monkey face" here is not one, not two, but four distinct
blobs. This is in fact a technical argument against it, though
referring to the technic of human cognition rather than machine's.
In this perspective, is it not clear that we should strive away from
symbol soup idioms? Let us write programs for people to read.
On Mon, 12 Aug 2019 at 20:03, Herbert Valerio Riedel <hvriedel at gmail.com> wrote:
>
> > - `(:[])`: Subjectively ugly.
>
> I consider "subjectively ugly" to be a non-technical and thus really
> weak argument to dismiss the list-idiomatic ninja-robot-operator (:[])
> which also happens to be shorter than the proposed alias for it. I for
> one don't see a significant benefit for adding a redundant synonym to
> `Data.List` and are thus -1 on this.
>
> > singleton :: a -> [a]
> > singleton x = [x]
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
More information about the Libraries
mailing list