gossamer/array
Types
Values
pub fn copy_within_range(
array: Array(a),
to target: Int,
from start: Int,
up_to end: Int,
) -> Array(a)
pub fn entries(
of array: Array(a),
) -> iterator.Iterator(#(Int, a), Nil, Nil)
pub fn find_index(
in array: Array(a),
one_that predicate: fn(a) -> Bool,
) -> Result(Int, Nil)
pub fn find_last(
in array: Array(a),
one_that predicate: fn(a) -> Bool,
) -> Result(a, Nil)
pub fn find_last_index(
in array: Array(a),
one_that predicate: fn(a) -> Bool,
) -> Result(Int, Nil)
pub fn from_list_mapped(
list: List(a),
with mapper: fn(a) -> b,
) -> Array(b)
pub fn includes_from(
in array: Array(a),
value value: a,
from index: Int,
) -> Bool
pub fn index_every(
in array: Array(a),
satisfying predicate: fn(a, Int) -> Bool,
) -> Bool
pub fn index_find(
in array: Array(a),
one_that predicate: fn(a, Int) -> Bool,
) -> Result(a, Nil)
pub fn index_find_index(
in array: Array(a),
one_that predicate: fn(a, Int) -> Bool,
) -> Result(Int, Nil)
pub fn index_find_last(
in array: Array(a),
one_that predicate: fn(a, Int) -> Bool,
) -> Result(a, Nil)
pub fn index_find_last_index(
in array: Array(a),
one_that predicate: fn(a, Int) -> Bool,
) -> Result(Int, Nil)
pub fn index_for_each(
in array: Array(a),
run callback: fn(a, Int) -> b,
) -> Nil
pub fn index_of_from(
in array: Array(a),
value value: a,
from index: Int,
) -> Result(Int, Nil)
pub fn index_reduce(
over array: Array(a),
from initial: b,
with callback: fn(b, a, Int) -> b,
) -> b
pub fn index_reduce_right(
over array: Array(a),
from initial: b,
with callback: fn(b, a, Int) -> b,
) -> b
pub fn index_some(
in array: Array(a),
satisfying predicate: fn(a, Int) -> Bool,
) -> Bool
pub fn keys(
of array: Array(a),
) -> iterator.Iterator(Int, Nil, Nil)
pub fn last_index_of(
in array: Array(a),
value value: a,
) -> Result(Int, Nil)
pub fn last_index_of_from(
in array: Array(a),
value value: a,
from index: Int,
) -> Result(Int, Nil)
pub fn pop(from array: Array(a)) -> Result(a, Nil)
Returns the removed element, or an error if the array is empty.
pub fn reduce(
over array: Array(a),
from initial: b,
with callback: fn(b, a) -> b,
) -> b
pub fn reduce_right(
over array: Array(a),
from initial: b,
with callback: fn(b, a) -> b,
) -> b
pub fn shift(from array: Array(a)) -> Result(a, Nil)
Returns the removed element, or an error if the array is empty.
pub fn sort(
array: Array(a),
by compare: fn(a, a) -> order.Order,
) -> Array(a)
pub fn splice(
in array: Array(a),
from start: Int,
removing count: Int,
) -> Array(a)
Removes elements and returns them. Mutates the array.
pub fn splice_with(
in array: Array(a),
from start: Int,
removing count: Int,
inserting items: List(a),
) -> Array(a)
Removes elements, inserts new ones, and returns the removed elements. Mutates the array.
pub fn to_sorted(
array: Array(a),
by compare: fn(a, a) -> order.Order,
) -> Array(a)
pub fn to_spliced_with(
array: Array(a),
from start: Int,
removing count: Int,
inserting items: List(a),
) -> Array(a)
pub fn values(
of array: Array(a),
) -> iterator.Iterator(a, Nil, Nil)