util/list.sh

List collection.

List()

List collection.

List_add()

Add an element to the list.

List_all_match()

Return true if all elements satisfy the predicate.

List_any_match()

Return true if any element satisfies the predicate.

List_clear()

Empty the list.

List_contains()

Return true if the list contains the given value.

List_delete()

Delete an element at the index.

List_eq()

Return true if two lists are the same (using references).

List_filter()

Create a list by filtering this list using the predicate.

List_first()

Return (the first element, 0); (_, $EC) if none exists.

List_get()

Get an element at the index.

List_is_empty()

Return true if the list is empty.

List_last()

Return (the last element, 0); (_, $EC) if none exists.

List_len()

Return (length of the list, 0). If there is an error, return (_, $EC).

List_map()

Apply mapper to each element in the list.

List_min()

Find min value (ints only).

List_reduce()

Reduce elements in the list with the given binary operator.

List_second()

Return (the second element, 0); (_, $EC) if none exists.

List_sum()

Sum all the elements (ints only).