algo module
Maylang standard-library module.
import "algo" as algo;
Module note —
chunkvalidates a positive size, including for empty input; invalid sizes raisechunk size must be positive.
Functions
quick_sort
fun quick_sort<T>(xs: List<T>) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
merge_sort
fun merge_sort<T>(xs: List<T>) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
merge_sorted
fun merge_sorted<T>(a: List<T>, b: List<T>) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
binary_search
fun binary_search<T>(sorted: List<T>, target: T) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
dedupe
fun dedupe<T>(xs: List<T>) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
zip
fun zip<A, B>(a: List<A>, b: List<B>) -> List<List<Any>>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
flatten
fun flatten<T>(xss: List<List<T>>) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
range_list
fun range_list(a: Int, b: Int) -> List<Int>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
take
fun take<T>(xs: List<T>, n: Int) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
drop
fun drop<T>(xs: List<T>, n: Int) -> List<T>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
chunk
fun chunk<T>(xs: List<T>, size: Int) -> List<List<T>>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
partition
fun partition<T>(xs: List<T>, pred: (T) -> Bool) -> List<List<T>>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
group_by
fun group_by<T, K>(xs: List<T>, key_fn: (T) -> K) -> Map<Str, List<T>>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
count_by
fun count_by<T, K>(xs: List<T>, key_fn: (T) -> K) -> Map<Str, Int>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source