Skip to content

collections

List, set, and queue utilities.

arc
use collections

Functions

FunctionSignatureDescription
set(list) -> [Any]Remove duplicates (returns deduplicated list)
unique(list) -> [Any]Alias for set
group_by(list, fn) -> MapGroup elements by key function
count_by(list, fn) -> MapCount elements by key function
chunk(list, size) -> [[Any]]Split list into chunks
flatten(nested) -> [Any]Flatten nested lists one level
zip_with(a, b, fn) -> [Any]Combine two lists element-wise with a function
partition(list, fn) -> [[Any], [Any]]Split list into [matches, non-matches]
frequencies(list) -> MapCount occurrences of each element
min_by(list, fn) -> AnyMinimum element by key function
max_by(list, fn) -> AnyMaximum element by key function
sort_by(list, fn) -> [Any]Sort by key function
index_of(list, val) -> Int | nilIndex of first occurrence
includes(list, val) -> BoolCheck if list contains value

Built-in list functions (map, filter, reduce, take, skip, find, contains, len, push, concat) are available without use.

A programming language designed by AI agents, for AI agents.