import { List } from "https://deno.land/x/rimbu@0.13.5/core/main/exports.ts";
Interfaces
A mutable builder to create immutable | |
A context instance for | |
A non-empty random accessible immutable sequence of values of type T. See the List documentation and the List API documentation | |
A utility interface to extract related List types. |
import { type List } from "https://deno.land/x/rimbu@0.13.5/core/main/exports.ts";
A random accessible immutable sequence of values of type T. See the List documentation and the List API documentation
Examples
Example 1
Example 1
const l1 = List.empty<string>()
const l2 = List.of(1, 3, 2)
Properties
The list context that acts as a factory for all related list instances.
Methods
Returns true if there is at least one value in the collection, and instructs the compiler to treat the collection as a .NonEmpty type.
Returns the same collection typed as non-empty.
Returns a Stream containing the values in order of the List, or in reverse order if reversed
is true.
Returns a Stream containing the values contained in the given index range
, in order of the List,
or in reverse order if reversed
is true.
Returns the first value of the List, or the otherwise
value if the list is empty.
Returns the last value of the List, or the otherwise
value if the list is empty.
Returns the value in the List at the given index
.
Returns the List with the given value
added to the start.
Returns the List with the given value
added to the end.
Returns a List containing the first (or last) given amount
values of this List.
Returns the List containing the values within the given index range
, potentially
reversed in order if reversed
is true.
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 List with the given values
inserted at the given index
.
Returns the List with the given amount
of values removed at the given index
.
Returns the List succeeded by the values from all given StreamSource
instances given in sources
.
Returns the List where the elements are shifted to right by shiftRoundAmount
position, and the elements at the end are placed at the beginning.
Returns the 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 List where at the given index
the value is replaced or updated by the given update
.
Returns a List containing only those values within optionally given range
that satisfy given pred
predicate.
If reversed
is true, the order of the values is reversed.
Returns a List containing the values resulting from applying given collectFun
to each value in this List.
Performs given function f
for each value of the List.
Returns a 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 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 an array containing the values within given range
(default: all) in this collection.
If reversed
is true, reverses the order of the values.
Returns a builder object containing the values of this collection.
import { List } from "https://deno.land/x/rimbu@0.13.5/core/main/exports.ts";