#root

data root/data/data.vi

Data structures.

List root/data/List.vi

struct List[T](...);

A linear collection of T.

Lists are optimized for fast concatenation and in-order iteration. Accessing the first value in a list is O(1), but accessing an arbitrary value is O(n).

let list = [1, 2, 3];
list.push_front(0);
list // [0, 1, 2, 3]
list.push_back(4);
list // [0, 1, 2, 3, 4]
list ++= [5, 6];
list // [0, 1, 2, 3, 4, 5, 6]
list.pop_front() // Some(0)
list // [1, 2, 3, 4, 5, 6]
for value in list.iter() {
  io.println("{value}"); // prints 1, 2, 3, 4, 5, 6
}

If frequently accessing elements by index, consider using an array instead.

Array root/data/Array.vi

struct Array[T](...);

A contiguous, indexed collection of T.

Values can be efficiently accessed by index, and added/removed from the beginning/end of the array.

Iterating over all of the values is less efficient; if this is being done regularly, consider using a List[T] instead.

Map root/data/Map.vi

struct Map[K, V](...);

Set root/data/Set.vi

struct Set[T](...);

Heap root/data/Heap.vi

struct Heap[T](...);

A min-heap, which provides efficient access to the smallest value in the heap.

Iterator root/data/Iterator.vi

trait Iterator[Self, Item];
  1. List

    1. Iter

      1. IterRef

      2. Array

        1. Map

          1. IterRef

            1. Iter

            2. Set

              1. IterRef

                1. Iter

                2. Heap

                  1. Iter

                  2. Iterator

                    1. Empty

                      1. One

                        1. FromNext

                          1. Map

                            1. Filter

                              1. FilterMap

                                1. Skip

                                  1. SkipWhile

                                    1. Take

                                      1. TakeWhile

                                        1. MapWhile

                                          1. Zip

                                            1. Flatten

                                              1. Concat

                                                1. Enumerate

                                                  1. Inspect

                                                    1. Collect

                                                      1. Fused