Vector
Vector is an array-like type that supports length/bounds checking at type-level. It also implements the dimensional interfaces and supports generic programming.
iota
(Fn [(Ref (Vector (Size a) b) c)] (Vector (Size a) (Index (Vector (Size a) Opaque) Int)))
(iota v)
map
(Fn [(Ref (Fn [a] b) c), (Ref (Vector (Size d) a) e)] (Vector (Size d) b))
(map f v)
Maps a function `f` over all the elements of a Vector and returns a new
Vector containing the results.
nth
(Fn [(Ref (Vector (Size a) b) c), (Index (Vector (Size a) Opaque) Int)] b)
(nth v ix)
Retrieves the nth element of a Vector using a given `Index`.
The given `Index` must have a `Size` equivalent to the `Vector`'s size in
its first position (the bound position).
If the `Index`'s Int value exceeds the length of the Vector, this
function will return the last element of the Vector.
push
(Fn [a, (Ref (Vector b a) c)] (Vector (Size b) a))
(push x v)
Adds an element to the end of a Vector, returning a new Vector.
tail
(Fn [(Ref (Vector (Size a) b) c)] (Vector a b))
(tail v)
Returns all but the first element of a Vector as a new Vector.
zip
(Fn [(Ref (Fn [a, b] c) d), (Ref (Vector e a) f), (Ref (Vector e b) g)] (Vector e c))
(zip f v v1)
Combines two Vectors using a binary function `f`.