algo module

Maylang standard-library module.

import "algo" as algo;

Module note — chunk validates a positive size, including for empty input; invalid sizes raise chunk size must be positive.

Functions

quick_sort

may
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

may
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

may
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

may
fun binary_search<T>(sorted: List<T>, target: T) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

dedupe

may
fun dedupe<T>(xs: List<T>) -> List<T>

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

zip

may
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

may
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

may
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

may
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

may
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

may
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

may
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

may
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

may
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