views:

256

answers:

1

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.

+9  A: 

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: http://talk-finger-tree.heroku.com/

Chouser
I wish I could be there. Can you be arm twisted into putting your slides on the web later?
Rob Lachlan
I believe slides *and* videos will be made available after the conference.
fogus
@fogus @Rob Indeed, I got confirmation a few days ago that the talks will will be taped.
Rayne