steady_vector

Hex versionCI statusSupported Erlang/OTP versionsAPI reference

steady_vector is a persistent vector for Erlang and Elixir: an array-like collection of values optimized for tail growth and shrinkage. It's heavily based on Dmitry Kakurin's PersistentVector implementation for Elixir and, other than some idiomatic changes and a few new functions, its interface is conceptually very similar.

steady_vector optimizes the following operations:

Getting the element count is O(1); most other operations are O(log32(N)).

It is implemented as a tree with 32-way branching at each level and uses structural sharing for updates. All ideas are borrowed directly from PersistentVector, which in turn borrowed them from Clojure.

Installation

Erlang

Add steady_vector to your list of dependencies in rebar.config:

{deps, [
{steady_vector, "~> 1.1"}
]}.

And then run rebar3 compile.

Elixir

Add steady_vector to your list of dependencies in mix.exs:

def deps do
[
{:steady_vector, "~> 1.1"}
]
end

And then run mix deps.get.

Documentation

The API reference is available on HexDocs.

Requirements

steady_vector is tested against Erlang/OTP 24 to 29. The supported build tool is rebar3.

License

steady_vector is licensed under the MIT license. See the LICENSE file for details.