Standard Library
Reference documentation for the Standard Library package, generated from source at 2026-09-27.
In the prelude
Visible in every file, with no import. 30 module(s).
BitsThe `Bits` module provides bitwise operations on `Integer`.
ConsoleANSI terminal styling. Color constants become empty strings when Kex is started with --no-colors, so callers can compose them without branching.
DigestCryptographic content digests. Hex strings are used at the public boundary so Kex programs never need to handle backend-specific binary values.
ENVENV : Map<String, String>
EvaluatorSandboxed evaluation of Kex source code at runtime.
HttpA capability: every member performs a real network request, so a test can replace it for a lexical region with `with Http = ...` rather than mutating global mock state (kexhq/kex#143).
IO
Kex
Kex.Kernel
Kex.Feature
Kex.InterfaceReturns the pretty-printed representation of any value as a STRING — the same form the REPL echoes. Universal: reachable on every type through UFCS.
MathThe `Math` module provides standard mathematical constants and functions. All trigonometric functions operate in radians. A Kex `Float` is always finite, so a domain error (`Math.sqrt(-1.0)`) or an overflow (`Math.exp(1000.0)`) raises rather than producing `NaN` or `Infinity` — the same rule BEAM enforces, where those two values cannot exist at all.
Integer
Float
Number
OptionParser
Process
Task
Set
UnorderedSet
Stream
String
SystemOperations concerning the running Kex system process.
TaggedValidationDiagnostics returned by optional compile-time tagged-literal validators. Byte offsets are zero-based and relative to the cooked literal body.
AssertFocused assertions are ordinary Kex stdlib functions layered on the primitive `assert`, so adding another helper does not require compiler or runtime work.
Type
UnitsThe time units are prelude-global, because every unit module measures against the same dimensions — `Units.SI` defines `Watt * Hour` with the `Hour` declared above, and future domains do the same. That makes `Hour` correct but not obviously located, so the same constructors are reachable under `Units` too, for call sites that would rather name where a unit comes from. These are aliases, not copies: each binds the identical constructor, so `Units.Hour` and `Hour` match the same patterns and compare equal.
Web
Web.Response
Web.Server
Opt-in
Available after an explicit using — using FS before FS.File.read.