Does anyone want intersperse for Data.Sequence?

David Feuer david.feuer at gmail.com
Mon Dec 29 21:23:28 UTC 2014


That sounds interesting, Ben. I'm sure everyone will be happy to try
them out when you put them up on GitHub and/or Hackage.

On Mon, Dec 29, 2014 at 2:25 PM, Ben <midfield at gmail.com> wrote:
> 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.
>
> b
>
> 1 - http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf
> 2 - https://github.com/clojure/core.rrb-vector/
>
>> On Dec 29, 2014, at 8:09 AM, Ross Paterson <R.Paterson at city.ac.uk> 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 haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries


More information about the Libraries mailing list