import { type List } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { NonEmpty } = List;
A non-empty random accessible immutable sequence of values of type T. See the List documentation and the List API documentation
Examples
Example 1
Example 1
const l = List.of(1, 3, 2)
Methods
Returns a non-empty Stream containing the values in order of the List, or in reverse order if reversed
is true.
Returns the first value of the List.
Returns the last value of the List.
Returns a List containing the first (or last) given amount
values of this List.
Returns the non-empty List succeeded by the values from all given StreamSource
instances given in sources
.
Returns a non-empty List that contains this List the given amount
of times.
Returns the non-empty List where the first given shiftAmount
of values are removed from this List, and are appended at the end.
Returns the non-empty List where, if given length
is larger than the List length, the given fill
value is added to the start and/or end
of the List according to the positionPercentage
such that the result length is equal to length
.
Returns the non-empty List where at the given index
the value is replaced or updated by the given update
.
Returns the non-empty List with the given values
inserted at the given index
.
Returns a non-empty List containing the result of applying given mapFun
to each value in this List.
If reversed
is true, the order of the values is reversed.
Returns a non-empty List containing the result of applying given mapFun
to each value in this List.
If reversed
is true, the order of the values is reversed.
Returns a List containing the joined results of applying given flatMapFun
to each value in this List.
Returns the values sorted according to the given, optional Comp.
Performance warning: this method is not designed for frequent calls;
should you need to keep in order a collection with potentially duplicate values,
please consider SortedMultiSet
instead.
Returns the List, where at the given index
the remove
amount of values are replaced by the values
from the optionally given insert
StreamSource
.
Returns the non-empty List in reversed order.
Returns an array containing the values within given range
(default: all) in this collection.
If reversed
is true, reverses the order of the values.