# 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](values-and-types.md),
[Logic](logic.md) and [Configuration and time](configuration-and-time.md).
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](collections.md); inline functions in [Passing functions](passing-functions.md) |
| `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](logic.md) |
| `decimal` | Operations on values built on `Decimal` | 13 (1 from Logic) | This page and [Logic](logic.md) |
| `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](batches-work-over-many-items.md) |
| `csv` | CSV files, read and written through batches | 2 | [Batches](batches-work-over-many-items.md) |
| `tsv` | TSV files, CSV's tab-separated form | 2 | [Batches](batches-work-over-many-items.md) |
| `json_lines` | JSON Lines files, one value per line | 2 | [Batches](batches-work-over-many-items.md) |
| `temporal` | Instants, dates, local times, zones, formats, recurrence | 24 (21 from Configuration and time) | [Zones and local times](zones-and-local-times.md) and this page |
| `locale` | Choosing a supported locale | 1 | [Choosing a locale from a request](locales.md#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](batches-work-over-many-items.md), and 135
defined here. Operators are counted apart, in
[the standard operator table](the-standard-operator-table.md). Operations
on geometry and AI are counted on the [Geospatial](geospatial.md) and
[AI](ai.md) 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](every-standard-type-meets-one-contract.md)).

The [design notes](https://github.com/jadpo-dev/jadpo/blob/main/docs/language/notes/19-standard-library.md) record why each part of
this page is the way it is, and [What is built](standard-library-built.md) says
which parts work today. One operation, `crypto.verify_totp`, waits on
keys held as data.
