Open bordoley opened 7 years ago
The main task here is to implement the concat, insertAt, and removeAt functions. The trie structure of the Vector already support RRB indexing, and it is used to enable efficient prepend and appends currently in the implementation.
RRB trees can be used to implement highly efficient random access vectors supporting splitAt, concat, insertAt and removeAt functions. I had a primitive implementation but decided not to include it as it did not implement some of the known optimizations, specifically focus nodes.
immutable-re already has a vector module internally, and this implementation would replace that implementation, make it public, and in the process improve Deque.update performance as well. Also we would likely replace internal uses of TreeList with the Vector implementation.
Note the key differences between Deque and Vector:
Proposed API:
References: