Proposal: Add singleton function to Data.List module

Herbert Valerio Riedel hvriedel at gmail.com
Wed Aug 14 17:10:16 UTC 2019


> `(:[])` is also unsatisfactory

Which is a purely subjective assessment (and one I clearly disagree with)

> To parse it properly, you need to:
>
> - Know that `:` is only allowed as an operator to prefix data constructors,
> - Know that `[]` are not legal operator characters,
> - Infer that you're intended to insert a space between the `:` and `[]` to get `(: [])`
> - Recognize it as an operator section being used prefix as a normal function

Indeed, in order to parse a legit Haskell term, be it (0(,)), (:[0])
or (:".exe") or (:[]) you need to know the core Haskell98 syntax. I'm
aware that other languages such as Elm or Purescript favor different
ideals and design principles but that's not really a good argument to
make either; each language has its own idioms and point in the design
space.

I'm still waiting for a statement of the technical problem we're
trying to solve here which requires the introduction of a redundant
synonym for a concise facility we already have at our disposal by
virtue of the core Haskell98 syntax. Otherwise I'm afraid we're going
to be stuck in this discussion as everything on the topic has been
said and repeated in one way or another and so far we haven't reached
any consensus.


More information about the Libraries mailing list