Does anyone want intersperse for Data.Sequence?

Ben midfield at
Mon Dec 29 19:25:27 UTC 2014

clojure-style persistent vectors based on hashed array mapped tries, or RRB-trees [1][2] would be great to have.  the basic structure is the same for unordered-container's hash maps, so reusing code there is a possibility.


1 -
2 -

> On Dec 29, 2014, at 8:09 AM, Ross Paterson <R.Paterson at> wrote:
> On Sun, Dec 28, 2014 at 11:01:46AM +0200, Roman Cheplyaka 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).
> Clearly Seq uses more space than arrays, but I estimate that a large
> Seq uses between 5/6 and 4/3 of the space of an equivalent list,
> with Seq's built with deque operations tending toward the lower end
> and append/split moving them toward the middle of the range.  So I'd
> say they're about the same (unless the list is deforested, of course).
> Do you have measurements that give different results?
>> It probably has its use cases, but most of the time you'd be better off
>> with one of the other choices:
> Those choices will beat Seq on particular operation mixes, but the virtue
> of Seq is that it gives decent performance over a broad set of operations.
> _______________________________________________
> Libraries mailing list
> Libraries at

More information about the Libraries mailing list