haskell / haskell/containers

Add // for Data.Sequence

未关闭
#262 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
feature-request Seq
主要语言
Haskell
星标
355
派生
194
平均合并
3 天 4 小时
30 天内合并 PR
4

描述

[Alan](http://stackoverflow.com/users/2913864/alan) has suggested [on StackOverflow](http://stackoverflow.com/questions/37505725/standard-queue-package-for-haskell/37506254?noredirect=1#comment62521038_37506254) that we add a `//` operator to `Data.Sequence` corresponding to the one in `Data.Array`. I believe that doing this efficiently likely requires access to `Data.IntMap`. We don't have that in `Data.Sequence` right now, but I'm hoping maybe the restructuring expected for the next major version after the upcoming one will allow us to do this.
### Implementation sketch

Collect all requested changes into an `IntMap`, then use something similar to `Data.Sequence.splitMap` with `Data.IntMap.split` to spread them through the tree. `splitMap` itself is overkill, because we'll likely be able to preserve whole subtrees. We may need to add some more splitting functions to `Data.IntMap`, if it supports them, but we probably want to do so anyway to match up with `Data.Map`.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。