package vec
Install
Dune Dependency
Authors
Maintainers
Sources
md5=3f89caa9ce2738c4c1acc1e66656646b
sha512=3b1d7314229ead76cd211bffb173ffcc6f2f52166113d32b1c3938a59a61c611b0517ce86102146dd800c29cb8200424204de0eaf0f6e7830abcdd8ca4c2532a
Description
This library provides efficient dynamic arrays with Rust-like mutability permissions.
Published: 24 Jan 2024
README
vec
Fast, safe mutable dynamic arrays for OCaml.
You can find API documentation here.
Summary
The idea behind this library is to provide efficient, mutable dynamic arrays with Rust-like mutability permissions.
To achieve this, the Vec.t
type uses a polymorphic variant as a phantom type parameter, which is [`R | `W]
for read-write vectors, [`R]
for read-only vectors, or [`W]
for write-only vectors.
All functions defined in the Vec
module are polymorphic in this type parameter, only requiring it to contain each function's needed capability.
For example, functions that only read data from a vector accept a ('a, [> `R]) Vec.t
parameter, so both [`R]
vectors and [`R | `W]
vectors can be passed.
Installing
The package can be found on OPAM here.
To install it, run:
opam install vec
Building from source
To build the project and run the test suite, run the following in the root of the repository:
dune build @doc @runtest
License
This repository is licensed under the terms of the GNU General Public License v3.
For more details, see the license file.