Standard library
The standard library is the set of types and operations every program can
use without declaring them, such as Money, list.count(items) and
temporal.in_zone(at, zone). A few are defined on the pages whose
features need them: Values and types,
Logic and Configuration and time.
This page collects them all, adds the types and operations real
applications keep reaching for, lists the language changes they rely on,
and says what is left out on purpose.
Operations are grouped into namespaces, each named for what it works on.
You always call an operation through its namespace: list.count(items),
never count(items).
| Namespace | Holds | Operations | Defined in |
|---|---|---|---|
list |
Operations on List<T> |
26 (4 from Values and types) | This page and Collections; inline functions in Passing functions |
set |
Operations on Set<T> |
7 | This page |
map |
Operations on Map<K, V> |
10 | This page |
range |
Operations on Range<T> and the ranges built on it |
3 | This page |
integer |
Operations on values built on Int |
5 (1 from Logic) | This page and Logic |
decimal |
Operations on values built on Decimal |
13 (1 from Logic) | This page and Logic |
money |
Money, its rates and discounts |
10 | This page |
units |
Physical quantities, DataSize and Bitrate |
3 | This page |
text |
Operations on text, and the contract's parse, format and from for every type |
21 | This page |
hash |
SHA-256 digests | 1 | This page |
encoding |
Bytes as text and back | 9 | This page |
crypto |
Encryption, passwords, signatures, message authentication | 10 | This page |
random |
Tokens, codes, shuffles; actions only | 5 | This page |
json |
One JSON document in memory, and large JSON lists through batches | 4 | This page; the batch forms in Batches |
csv |
CSV files, read and written through batches | 2 | Batches |
tsv |
TSV files, CSV's tab-separated form | 2 | Batches |
json_lines |
JSON Lines files, one value per line | 2 | Batches |
temporal |
Instants, dates, local times, zones, formats, recurrence | 24 (21 from Configuration and time) | Zones and local times and this page |
locale |
Choosing a supported locale | 1 | Choosing a locale from a request |
colour |
Converting Colour between spaces, contrast |
5 | This page |
web |
Building URLs, address blocks | 3 | This page |
semver |
Version ranges | 1 | This page |
media |
Fitting dimensions | 1 | This page |
markup |
Markdown and HTML, made safe | 3 | This page |
There are 171 operations in all: 28 defined on the Values and types, Logic, and Configuration and time pages, 8 file helpers defined with batches, and 135 defined here. Operators are counted apart, in the standard operator table. Operations on geometry and AI are counted on the Geospatial and AI pages.
Every standard type also gets the same baseline of operations, generated
for it and not counted per type: construction, text.parse,
text.format, text.from, JSON, storage, == and order
(Every standard type meets one contract).
The design notes record why each part of
this page is the way it is, and What is built says
which parts work today. One operation, crypto.verify_totp, waits on
keys held as data.
Markdown for agents: /docs/standard-library.md.Built from Jadpo main at a707efb.