Does anyone want intersperse for Data.Sequence?

John Lato jwlato at gmail.com
Mon Dec 29 00:02:23 UTC 2014


It depends what you mean. Seq has nice asymptotics but quite poor constant
factors.
Do you consider DList as requiring a separate building phase?  If so, the
answer is quite possibly that the data structure you want doesn't exist.
But for most code I think the existing solutions are good enough (and
performance requirements lax enough) that nobody has put much effort into
anything better.

John L.

On 08:30, Sun, Dec 28, 2014 Greg Weber <greg at gregweber.info> wrote:

> I want an interface that supports efficient appending without requiring a
> separate building phase or other hassles. Does this not exist?
>
> I get that a library author might want to deal with the hassle of
> alternatives. But as an application author there are times that all I care
> about is a clean and simple interface that supports efficient appends.
>
> On Sun, Dec 28, 2014 at 1:01 AM, Roman Cheplyaka <roma at ro-che.info> wrote:
>
>> On 27/12/14 17:03, Greg Weber wrote:
>> > Sequence is not used nearly enough.
>>
>> Not really. Seq has high constant factors and for small sizes is often
>> slower than plain lists. Nor is it space-efficient (for big sizes).
>>
>> It probably has its use cases, but most of the time you'd be better off
>> with one of the other choices:
>>
>> * plain old lists
>> * difference lists (trees)
>> * lists "without remorse"
>> * vectors
>> * lazy vectors (lists of vectors)
>>
>> Roman
>>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141229/4d26857f/attachment-0001.html>


More information about the Libraries mailing list