<div dir="ltr">`(\x -> [x])` has the same polymorphism problem in the context of `OverloadedLists` as `pure`.<div><br></div><div>`(:[])` is also unsatisfactory. To parse it properly, you need to:</div><div><br></div><div>- Know that `:` is only allowed as an operator to prefix data constructors,</div><div>- Know that `[]` are not legal operator characters,</div><div>- Infer that you're intended to insert a space between the `:` and `[]` to get `(: [])`</div><div>- Recognize it as an operator section being used prefix as a normal function</div><div><br>I'm neither an expert nor a lifelong Haskeller, but I have been writing it in some professional capacity for four years now, and the operator section trips me up. I can't imagine less experienced folks find it easy or intuitive. You can't even search for it on hoogle: <a href="https://hoogle.haskell.org/?hoogle=(%3A%5B%5D)">https://hoogle.haskell.org/?hoogle=(%3A%5B%5D)</a></div><div><br></div><div>Is `(:[])` a core idiom? I never see it in work code and I've never seen it in Hackage. To check, I grepped my software directory which has all my Haskell code, and got 122 matches of (:[]) over 1,768,231 loc (as given by wc -l **/*.hs).</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Matt Parsons</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 13, 2019 at 4:56 PM Herbert Valerio Riedel <<a href="mailto:hvriedel@gmail.com">hvriedel@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> The point is to create a monomorphic variant [...]<br>
<br>
But we already have at least two monomorphic variants to express this<br>
with Haskell's concise native syntax and vocabulary which has by<br>
design a preferential treatment of lists (it was considered even more<br>
important than type-sigs so that we got the `:` cons operator for<br>
lists and the `::` for type-sig annotations) -- so let's not try to<br>
fight Haskell's core idioms by hiding them behind some trivial<br>
additional redundant synonyms! I still fail to see the actual<br>
*technical* problem being solved by the original proposal asking to<br>
add yet another, wordy way to construct single-item-lists.<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>