<div dir="ltr"><div><div><div>You don't need to use the usual NonEmpty type. You can copy it here.<br><br></div><div>data NonEmpty a = a :< [a]<br></div><div>data ListNELists a = Cons {-# UNPACK #-} !(NonEmpty a) (ListNELists a) | Nil<br></div><div><br></div><div>Or we could unpack it manually:<br><br></div>data ListNELists a = Cons a [a] (ListNELists a) | Nil<br><br></div>I can't say whether these will make a difference. I'm sorry that I haven't had the time to really dig into this issue as much as I might; I've been tied up with other things.<br><br><br></div>David<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 10:53 PM, Siddhanathan Shanmugam <span dir="ltr"><<a href="mailto:siddhanathan+eml@gmail.com" target="_blank">siddhanathan+eml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Mar 28, 2017 at 12:48 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">There are a number of intermediate lists that are certainly non-empty, but their types don't reflect that. I wonder if using a non-empty list type unpacked into the list of lists might be helpful.</div></blockquote><div><br></div></span><div>I just tried it. Seems to work fine, and the benchmark numbers are similar.</div><div><br></div><div>Doing this in base would introduce cyclic dependencies though.</div><span class=""><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_2364851430999545549h5">On Mar 28, 2017 3:39 PM, "Gregory Popovitch" <<a href="mailto:greg7mdp@gmail.com" target="_blank">greg7mdp@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_2364851430999545549h5"><u></u>



<div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri">OK, here is the current proposed change - tests look 
good:</font></span></div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri"></font></span> </div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><img src="cid:159493719@28032017-03A3"></span></div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri"></font></span> </div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri">Any comments/opposition from the community?</font></span></div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri"></font></span> </div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri">Thanks,</font></span></div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri"></font></span> </div>
<div dir="ltr" align="left"><span class="m_2364851430999545549m_-3113656729827203741m_-3213585517565692730159493719-28032017"><font color="#000080" face="Calibri">greg</font></span></div>
<div class="gmail_extra"><font color="#000080" face="Calibri"></font> </div></div>
<br></div></div><span>______________________________<wbr>_________________<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-bi<wbr>n/mailman/listinfo/libraries</a><br>
<br></span></blockquote></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div>