abla/array

Generated from source.

Import with import "abla/array".

Source: abla/array/entry.ab

array<T>.mapped (extension fun)

@inline fun <T, R> array<T>.mapped(transform: (T) -> R): array<R>

Returns a fresh array by calling transform once for each element in order. Resource element types are rejected at compile time, for both input and output.

array<T>.removeLast (extension fun)

fun <T> array<T>.removeLast(): T

Moves out the last element in O(1). An empty array panics on the index.

array<T>.removeAt (extension fun)

fun <T> array<T>.removeAt(index: int): T

Moves out an element, preserving the order of the remaining elements. An invalid index panics before the array is changed.

array<T>.sortedBy (extension fun)

fun <T> array<T>.sortedBy(less: (T, T) -> bool): array<T>

A copy of the array ordered by less, which says whether its first argument must come before the second (a strict order: less(a, a) is false). A stable merge sort, O(n log n): elements that neither comes before the other keep their order. The array itself is not changed.

array<int>.sorted (extension fun)

fun array<int>.sorted(): array<int>

A copy of the integers in ascending order (stable merge sort, O(n log n)).

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.