PreviousUpNext

14.2.54  Vector

The standard library Vector api defines access to vanilla typeagnostic immutable vectors.

The Vector api is implemented by the vector package.

The Vector api source code is in src/lib/std/src/vector.api.

See also: Typelocked_Vector api.

See also: Rw_Vector api.

See also: Vector_Slice api.

The above information is manually maintained and may contain errors.

api {
    eqtype Vector X;
    maximum_vector_length : Int;
    from_list : List(X ) -> Vector(X );
    from_fn : (Int , (Int -> X)) -> Vector(X );
    length : Vector(X ) -> Int;
    get : (Vector(X ) , Int) -> X;
    _[] : (Vector(X ) , Int) -> X;
    set : (Vector(X ) , Int , X) -> Vector(X );
    _[]:= : (Vector(X ) , Int , X) -> Vector(X );
    cat : List(Vector(X ) ) -> Vector(X );
    keyed_apply : ((Int , X) -> Void) -> Vector(X ) -> Void;
    apply : (X -> Void) -> Vector(X ) -> Void;
    keyed_map : ((Int , X) -> Y) -> Vector(X ) -> Vector(Y );
    map : (X -> Y) -> Vector(X ) -> Vector(Y );
    keyed_fold_forward : ((Int , X , Y) -> Y) -> Y -> Vector(X ) -> Y;
    keyed_fold_backward : ((Int , X , Y) -> Y) -> Y -> Vector(X ) -> Y;
    fold_forward : ((X , Y) -> Y) -> Y -> Vector(X ) -> Y;
    fold_backward : ((X , Y) -> Y) -> Y -> Vector(X ) -> Y;
    keyed_find : ((Int , X) -> Bool) -> Vector(X ) -> Null_Or(((Int , X)) );
    find : (X -> Bool) -> Vector(X ) -> Null_Or(X );
    exists : (X -> Bool) -> Vector(X ) -> Bool;
    all : (X -> Bool) -> Vector(X ) -> Bool;
    compare_sequences : ((X , X) -> Order) -> (Vector(X ) , Vector(X )) -> Order;};


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext