<div dir="ltr">I'm personally -1 on this proposal <i>at this time</i>. Adding these to the footprint of Prelude means everybody who has written any data type with a data constructor named :| breaks, every combinator named nonEmpty, NonEmpty type or class... so we shouldn't do this lightly.<div><div><br></div><div>That said, Semigroup is slated to become a superclass of Monoid in 8.6 and move into Prelude as part of the timeline onĀ </div><div><br></div><div><a href="https://prime.haskell.org/wiki/Libraries/Proposals">https://prime.haskell.org/wiki/Libraries/Proposals<br></a></div><div><br></div><div>and Semigroup has sconcat as a member, which references NonEmpty. At that point the case becomes much stronger, and the need to decide how to handle sconcat for the Prelude acts as a forcing function for this decision.</div><div><br>On the other hand, we don't have many classes exported from Prelude partially, but we do have them: Functor (<$), Read (readPrec, readListPrec), Floating (log1p, expm1, etc.) come to mind as members we avoid exporting from Prelude.<br><br>So while there is precedent for continuing to hide "messy" implementation details, at that point the weight of simplicity of explanation may come down on the other side of the argument.</div><div><br></div><div>With all that in mind I'm -1 if we're talking about adding this in 8.4, but I'm largely neutral and maybe even weakly positive about it for 8.6 as part of the larger Semigroup migration and would be happy to accept either the hidden detail solution or a solution that dragged NonEmpty into base based on community feedback.</div><div><br></div><div><div>-Edward</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 28, 2016 at 2:39 PM, Yitzchak Gale <span dir="ltr"><<a href="mailto:gale@sefer.org" target="_blank">gale@sefer.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In continuation of Simon Jakobi's proposal for a small<br>
incremental change to the Prelude to make it more<br>
conducive to partial-function-free programming,<br>
<br>
<a href="https://mail.haskell.org/pipermail/libraries/2016-December/027496.html" rel="noreferrer" target="_blank">https://mail.haskell.org/<wbr>pipermail/libraries/2016-<wbr>December/027496.html</a><br>
<br>
and after some encouragement from the community on reddit,<br>
I propose adding the basic constructors of NonEmpty to<br>
the Prelude: nonEmpty, (:|), and the type constructor NonEmpty.<br>
<br>
In practice, users of NonEmpty will often still need a qualified<br>
import of Data.List.NonEmpty. But having the constructors<br>
available in the Prelude will make the use of NonEmpty more<br>
common, and will make programming without partial functions<br>
feel more natural and standard.<br>
<br>
Note: This proposal is separate from Simon's and should not<br>
interfere with the acceptance of Simon's. But it is related in<br>
that it attempts to achieve the same goals.<br>
<br>
Discussion period: Until the end of the discussion period of<br>
Simon's proposal.<br>
<br>
Thanks,<br>
Yitz<br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">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-<wbr>bin/mailman/listinfo/libraries</a><br>
</blockquote></div><br></div>