package containers-data
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=92143ceb4785ae5f8a07f3ab4ab9f6f32d31ead0536e9be4fdb818dd3c677e58
sha512=5fa80189d0e177af2302b48e72b70299d51fc36ac2019e1cbf389ff6a7f4705b10089405b5a719b3e4845b0d1349a47a967f865dc2e4e3f0d5a0167ef6c31431
doc/containers-data/CCPersistentArray/index.html
Module CCPersistentArraySource
Persistent Arrays
From the paper by Jean-Christophe Filliâtre, "A persistent Union-Find data structure", see the ps version
The type of persistent arrays
make n x returns a persistent array of length n, with x. All the elements of this new array are initially physically equal to x (in the sense of the == predicate). Consequently, if x is mutable, it is shared among all elements of the array, and modifying x through one of the array entries will modify all other entries at the same time.
init n f returns a persistent array of length n, with element i initialized to the result of f i.
Apply the given function to all elements of the array, and return a persistent array initialized by the results of f. In the case of mapi, the function is also given the index of the element. It is equivalent to fun f t -> init (fun i -> f (get t i)).
iter f t applies function f to all elements of the persistent array, in order from element 0 to element length t - 1.
of_list l returns a fresh persistent array containing the elements of l.
of_rev_list l is the same as of_list (List.rev l) but more efficient.