Skip to content

Standard library

Every function of std, indexed from 13. Standard Library, the normative chapter; each namespace links to the section that states its semantics in full. The SI unit catalog is declarations, not functions: §13.10.

§13.2

Function Signature Semantics
std.array.count count<T>(xs: T[]): int number of elements
std.array.all all<T>(xs: T[], p: (T) => bool): bool true iff p holds for every element; true on []
std.array.any any<T>(xs: T[], p: (T) => bool): bool true iff p holds for some element; false on []
std.array.all_distinct all_distinct<T>(xs: T[]): bool true iff no two elements are equal (§4.5 equality, including place equality for references)
std.array.filter filter<T>(xs: T[], p: (T) => bool): T[] elements satisfying p, in order
std.array.fold fold<T, A>(xs: T[], init: A, f: (A, T) => A): A left fold: f(…f(f(init, xs[0]), xs[1])…) — the language’s general iteration (D17)
std.array.sum sum<T: int | float>(xs: T[]): T left-to-right sum; 0/0.0 on []; float rounding per element in array order (§9.5)

§13.3

Function Signature Semantics
std.math.abs abs<T: int | float>(x: T): T absolute value
std.math.min min<T: int | float>(a: T, b: T): T, max<T: int | float>(a: T, b: T): T smaller / larger operand; mixing int and float fails to instantiate T — a type error
std.math.clog clog2(n: int): int ceiling of log₂ — smallest k with 2^k >= n; domain n >= 1 (E5008 otherwise)
std.math.floor floor(x: float): int greatest integer <= x
std.math.ceil ceil(x: float): int least integer >= x
std.math.round round(x: float): int nearest integer, ties to even (banker’s rounding — deterministic)

§13.4

Function Signature Semantics
std.int.of of(x: float): int exact conversion; domain: x has no fractional part (E5008 otherwise — use floor/ceil/round to choose a rounding)
std.int.at_least at_least(n: int): (int) => bool predicate v >= n — the one-sided-range predicate (§3.4)
std.int.at_most at_most(n: int): (int) => bool predicate v <= n

§13.5

Function Signature Semantics
std.float.of of(n: int): float nearest binary64, ties to even; domain: magnitude within binary64’s finite range (E5008 otherwise — D24 forbids ±Infinity)

§13.6

Function Signature Semantics
std.string.of of(v: int | float | bool): string exactly the template-interpolation conversions (§4.11): decimal, shortest round-trip, true/false
std.string.length length(s: string): int number of Unicode code points (not bytes, not UTF-16 units — fixed for determinism)
std.string.join join(xs: string[], sep: string): string elements joined with sep; "" on []
std.string.starts_with starts_with(s: string, prefix: string): bool true iff s begins with prefix (code-point-wise)
std.string.ends_with ends_with(s: string, suffix: string): bool true iff s ends with suffix (code-point-wise) (v0.1.6)
std.string.contains contains(s: string, sub: string): bool true iff sub occurs in s (code-point-wise) (v0.1.6)
std.string.split split(s: string, sep: string): string[] substrings between occurrences of sep, in order (split("a->b", "->") is ["a", "b"]; "" elements are kept); domain: sep != "" (E5008) (v0.1.6)

§13.7

Function Signature Semantics
std.object.merge merge<T>(base: T, patch: T): T deep merge of two values of the same record type

§13.8

Function Signature Semantics
std.map.keys keys<V>(m: { [string]: V }): string[] keys in insertion order (D23)
std.map.values values<V>(m: { [string]: V }): V[] values in insertion order
std.map.entries entries<V>(m: { [string]: V }): { key: string, value: V }[] key/value records in insertion order

§13.9

Function Signature Semantics
std.ref.path path<T>(r: ref<T>): string the absolute canonical path of the target (§7.2) — always absolute, never the $-relative wire form

© 2026 Luuvish. Decl is open source under the MIT License.

Type: Literata and IBM Plex, under the SIL Open Font License. Built with Astro Starlight.