# Standard vector functions.

.

Convert a list to a vector.

Create an empty vector.

fun at( ^v : vectorstd/core/types/vector: V -> V<a>, ^index : intstd/core/types/int: V ) : maybestd/core/types/maybe: V -> V<a>

Return the element at position `index` in vector `v`, or `Nothingstd/core/types/Nothing: forall<a> maybe<a>` if out of bounds.

fun foreach( v : vectorstd/core/types/vector: V -> V<a>, f : (a) -> e () ) : e ()

Invoke a function `f` for each element in a vector `v`.

( v : vectorstd/core/types/vector: V -> V<a>, f : (intstd/core/types/int: V, a) -> e () ) : e ()

Invoke a function `f` for each element in a vector `v`.

Invoke a function `f` for each element in a vector `v`. If `f` returns `Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>`, the iteration is stopped early and the result is returned.

Return the length of a vector.

Convert a vector to a list.

fun map( v : vectorstd/core/types/vector: V -> V<a>, f : (a) -> e b ) : e vectorstd/core/types/vector: V -> V<b>

Apply a total function `f` to each element in a vector `v`.

fun vector( ^n : intstd/core/types/int: V, default : a ) : vectorstd/core/types/vector: V -> V<a>

Create a new vector of length `n` with initial elements `defaultstd/core/exn/default: forall<a> (t : error<a>, def : a) -> a` .

Create a new vector of length `n` with initial elements given by function `f` which can have a control effect.

Create a new vector of length `n` with initial elements given by total function `f`. (can be more efficient than `vector-initstd/core/vector/vector-init: forall<a,e> (n : int, f : (int) -> e a) -> e vector<a>`).

fun vlist( v : vectorstd/core/types/vector: V -> V<a>, tail : ? (liststd/core/types/list: V -> V<a>) ) : liststd/core/types/list: V -> V<a>

Convert a vector to a list with an optional tail.