<div dir="ltr">Sequence is not used nearly enough. I think anything useful in the List API should also be in the Sequence API.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 27, 2014 at 5:50 AM, 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">Anyone else have an opinion? Bertram Felgenhauer pointed out to me<br>
that a friendlier-looking expression is<br>
<br>
intersperse x xs = drop 1 $ fromList xs <**> fromList [const x, id]<br>
<br>
but this still may not be the most obvious thing. The main question, I<br>
think, is whether anyone is likely to *use* an intersperse function<br>
for sequences. If so, I think we should add it; if not, probably not.<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Dec 22, 2014 at 7:11 AM, Felipe Lessa <<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>> wrote:<br>
> On 22-12-2014 09:03, David Feuer wrote:<br>
>> containers master now uses a new mechanism to implement <*> that can<br>
>> also be used directly to implement an efficient intersperse function<br>
>> corresponding to the one in Data.List. The real question is whether<br>
>> anyone wants one. The potential for clashing names is obviously a<br>
>> point against. The other is that the same asymptotic bounds (but<br>
>> almost certainly worse constant factors) can be obtained using<br>
>><br>
>> intersperse x xs = drop 1 $ forwards $ Backwards (fromList [const x,<br>
>> id]) <*> Backwards xs<br>
><br>
> If the name clash is the only downside, I'm +1.  That intersperse<br>
> definition isn't obvious :).<br>
><br>
> Cheers,<br>
><br>
> --<br>
> Felipe.<br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>