我应该使用 Clojure 的手指树做什么?
Clojure 的新 contrib 库组有一个 手指树 库。 Clojure 中手指树的用例有哪些?何时应该使用手指树来代替 clojure 的其他持久数据结构之一:向量、集合、映射、持久队列等。
Clojure 的乐趣 提到手指树可用于需要廉价插入和删除的索引集合。它们也被描述为“数据结构的瑞士军刀”。非常感谢这样的例子。
Clojure's new contrib library group has a finger tree library. What are the use cases for finger trees in clojure? When should finger trees be used instead of one of clojure's other peristent data strucures: vectors, sets, maps, persistentqueues, etc.
The Joy of Clojure mentions that Finger trees can be used for indexed collections where cheap insertions and deletions are required. They have also been described as the "swiss army knife of data structures." Examples of this would be very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ralf Hinze 和 Ross 的论文中描述了 2-3 个手指树帕特森。它们不仅提供了数据结构本身的完整描述,还提供了如何在 Haskell 中使用它的几个示例。他们描述的大多数功能已经在 Clojure 库中提供,但文档还没有。
本周末我将在 Clojure Conj 上介绍 Clojure 手指树。
更新: 现在有一些示例显示在 http:// github.com/clojure/data.finger-tree#readme
更新: 演讲幻灯片:https://github.com/Chouser/talk-finger-tree/blob/master/finger-trees.pdf
更新:演讲视频:http://www.youtube.com/观看?v=UXdr_K0Lwg4
2-3 finger trees are described in a paper by Ralf Hinze and Ross Paterson. They provide not only a complete description of the data structure itself, but several examples of how it can be used ...in Haskell. Most of the features they describe are already available in the Clojure library, but the documentation simply isn't there yet.
I'll be introducing Clojure finger trees at Clojure Conj this weekend.
Update: There are now some examples shown at http://github.com/clojure/data.finger-tree#readme
Update: Slides from the talk: https://github.com/Chouser/talk-finger-tree/blob/master/finger-trees.pdf
Update: Video of the talk: http://www.youtube.com/watch?v=UXdr_K0Lwg4