Proposal: Add singleton function to Data.List module

Elliot Cameron eacameron at gmail.com
Tue Aug 13 00:07:07 UTC 2019


+1 and for NonEmpty. It's a common pattern for containers and I've always
been annoyed that List did not go with the flow.

On Mon, Aug 12, 2019 at 6:36 PM Theodore Lief Gannon <tanuki at gmail.com>
wrote:

> On Mon, Aug 12, 2019, 12:53 PM Andrew Lelechenko <
> andrew.lelechenko at gmail.com> wrote:
>
>> Adding singleton to Data.List is a breaking change, when
>> Data.Map.singleton was exported unqualified.
>>
>
> Data.Map's documentation states that the entire module should be imported
> qualified; this is not a reasonable counterargument.
>
> RIO even takes the potentially-conflicting List functions out of Prelude,
> and puts them in a RIO.List module which is also intended for qualified
> import.
>
> I'm +1. Personally I prefer `pure` and have TypeApplication enabled
> globally; but that's not a universal style, and I see no real cost here
> (though I agree it shouldn't be exposed in Prelude).
>
> NonEmpty should get one too.
>
>> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190812/20823fe5/attachment.html>


More information about the Libraries mailing list