Standard Library
This is the reference sidecar. Reach for it when you need to know what a specific module exports today. If you are still learning AIVI, start with Tutorials or How-to Guides first, then come back here when you know the job or module you need.
The AIVI standard library is the set of modules that ships with the language. Some names, such as Option, Result, Signal, and Task, are built in. Most other tools live in named modules that you import with use.
Use this page as a map:
- start with the modules in Start here if you are new to AIVI
- use the grouped lists below when you already know the job you need to do
- treat each linked page as the source of truth for what the current stdlib actually exposes
Several modules are intentionally small today, and some are shared type vocabularies rather than full runtime clients. Their pages call that out up front so you do not have to guess.
How to read module pages
| Module page shape | What the top tables show | Typical examples |
|---|---|---|
| Pure helper module | The full exported function battery for the module | aivi.option, aivi.result, aivi.list, aivi.math, aivi.bool |
| Vocabulary / capability module | The exported types, handles, and canonical members | aivi.fs, aivi.http, aivi.db, aivi.env |
| Mixed module | Separate tables for core operations and higher-level helpers | aivi.text, aivi.prelude, aivi.matrix |
If you open a module page and only want the quick answer to "what does this include?", jump to the At a glance section near the top.
For external systems, prefer provider capabilities defined through @source. The related stdlib modules now mainly carry shared data vocabulary and handle-marker types such as FsSource, HttpSource, EnvSource, and LogSource.
After aivi.prelude, the modules most people reach for first are aivi.option, aivi.result, aivi.list, aivi.text, and aivi.math.
At a glance
| Module | Description | Selected exports or capability members |
|---|---|---|
| aivi.prelude | Built-in types, classes, and generic ordering | Validation, Functor, min, max, clamp |
| aivi.async | Async operation lifecycle tracker | AsyncTracker, step, isPending, isDone, isFailed |
| aivi.option | Values that may be missing | getOrElse, map, flatMap, toResult |
| aivi.result | Success-or-error values | withDefault, map, mapErr, flatMap |
| aivi.validation | Validation conversions and combinators | getOrElse, mapErr, andThen, fold |
| aivi.core.either | Disjoint union holding one of two alternatives | Left, Right, mapLeft, mapRight |
| aivi.list | Purely functional list operations | map, filter, maximum, unique, sort |
| aivi.nonEmpty | Non-empty list guaranteed at the type level | head, last, singleton, cons, fromList |
| aivi.pair | Two-element tuples | first, second, mapFirst, mapSecond |
| aivi.matrix | Rectangular 2D collections | init, fromRows, width, height, rows |
| aivi.core.dict | Association map keyed by any Eq type | Dict, get, insertWith, fromList |
| aivi.core.set | Unordered set for any Eq type | singleton, member, insert, fromList |
| aivi.core.range | Inclusive integer range [start, end] | RangeInt, make, length, contains |
| aivi.core.fn | Higher-order function combinators | compose, const, flip, on |
| aivi.arithmetic | Compiler-backed integer arithmetic intrinsics | add, sub, mul, div, mod, neg |
| aivi.order | Ord-driven ordering plus explicit comparator helpers | min, max, minBy, clampBy |
| aivi.bool | Boolean helpers | both, either, not, xor |
| aivi.bits | Compiler-backed bitwise integer intrinsics | and, or, xor, not, shiftLeft |
| aivi.defaults | Default values for common types | defaultText, defaultInt, defaultBool |
| aivi.math | Integer arithmetic utilities | abs, clamp, min, max, gcd |
| aivi.core.float | IEEE 754 double-precision helpers | floor, ceil, round, sqrt, pi |
| aivi.bigint | Arbitrary-size integers | fromText, add, mul, div |
| aivi.text | Text manipulation | length, contains, trim, split, toUpper |
| aivi.regex | Regular-expression matching and replacement | isMatch, findText, replace, findAll |
| aivi.core.bytes | Byte sequence operations | fromText, toText, slice, append |
| aivi.data.json | JSON text helpers plus structural JSON types | validate, get, pretty, Json |
| aivi.duration | Typed time spans | ms, sec, min, hr, millis |
| aivi.time | Clocks, timestamps, and duration arithmetic | nowMs, monotonicMs, toSeconds, elapsed |
| aivi.date | Calendar data and pure formatting | Date, TimeOfDay, DateDelta, dateToIso |
| aivi.timer | Marker types for timer-backed signals | TimerTick, TimerReady, TimerMode |
| aivi.random | Randomness vocabulary and RandomSource | RandomSource, RandomError |
| aivi.fs | Filesystem vocabulary and FsSource | FsSource, FsError, FsEvent |
| aivi.path | Pure lexical path operations on Text | join, filename, parent, extension |
| aivi.env | Environment vocabulary and EnvSource | EnvSource, EnvEntry |
| aivi.stdio | Standard I/O vocabulary and StdioSource | StdioSource, Stream, Stdout, Stderr |
| aivi.log | Logging vocabulary and LogSource | levelToText, kv, LogSource |
| aivi.process | Process vocabulary and ProcessSource | command, args, workingDir, env |
| aivi.url | Typed URLs with explicit parsing | Url, UrlError, parse, toText |
| aivi.http | HTTP vocabulary and HttpSource | HttpSource, HttpResponse, HttpError |
| aivi.api | OpenAPI capability auth and error vocabulary | ApiAuth, ApiError, ApiResponse |
| aivi.auth | OAuth 2.0 / PKCE sign-in records | PkceConfig, PkceToken, PkceState |
| aivi.db | Database vocabulary and DbSource | query, commit, DbSource |
| aivi.imap | Mailbox and folder types for IMAP integrations | FolderSummary, MailEvent, lastSyncedAt |
| aivi.smtp | Outgoing mail configuration and messages | from, to, subject, bodyText, SmtpConfig |
| aivi.desktop.xdg | XDG error vocabulary | dataHome, configHome, cacheHome |
| aivi.portal | Desktop portal result vocabulary plus built-in portal sources | openFile, openUri, screenshot |
| aivi.dbus | D-Bus vocabulary and DbusSource | destination, path, interface, member |
| aivi.gnome.tray | GNOME tray bridge vocabulary | TraySource, defaultPath, actionMember |
| aivi.gnome.settings | GSettings schema, key, and value types | SettingsSchema, SettingsKey, SettingValue |
| aivi.gnome.onlineAccounts | Desktop account and token records | id, token, tokenType, expiresAt |
| aivi.gnome.notifications | Desktop notification capability vocabulary | NotificationSource, NotificationTask, NotificationEvent |
| aivi.clipboard | Clipboard content types and watcher shapes | ClipboardContent, ClipboardSource |
| aivi.color | Packed ARGB color domain with blend and GNOME palette | Color, blend, gnomeBlue3, gnomeRed3 |
| aivi.px | Pixel dimension domain for type-safe sizing | px, addPx, subPx, scalePx, zero |
| aivi.gtk.styles | Adwaita CSS class name constants | suggestedAction, destructiveAction, classes |
| aivi.gtk.icons | Icon-name text constants | documentOpen, documentSave, goHomeSymbolic |
| aivi.secret | Desktop keyring capability vocabulary | SecretSource, SecretError, SecretTask |
| aivi.image | Image data, metadata, and load errors | format, size, bytes, hasAlpha |
| aivi.gresource | Bundled GResource paths and load errors | ResourcePath, ResourceError, ResourceTask |
Built-in types you will see often
| Type | Meaning | More |
|---|---|---|
Ordering | The result of comparing two values: Less, Equal, or Greater. | aivi.order |
Option A | A value that may be missing. | aivi.option |
Result E A | A success value (Ok) or a failure value (Err). | aivi.result |
Validation E A | Like Result, but useful when checking several independent inputs. | aivi.validation |
Signal A | A reactive value that changes over time. | Signals guide |
Task E A | Runtime work that may fail with E or succeed with A. | Used across I/O-oriented stdlib modules |
Browse modules by area
Start here
aivi.prelude— a good first stop for everyday imports.aivi.defaults— named empty/default values for common built-in types.
Core values and collections
aivi.bool— boolean helpers.aivi.option— values that may be missing.aivi.result— success-or-error values.aivi.validation— validation values for user input and other checks.aivi.core.either— values that can hold one of two branches.aivi.list— list helpers.aivi.matrix— rectangular two-dimensional collections.aivi.nonEmpty— lists that always contain at least one item.aivi.pair— two values grouped together.aivi.order— comparison results and ordering helpers.aivi.core.dict— key/value dictionaries.aivi.core.set— collections of unique values.aivi.core.range— numeric ranges.aivi.core.fn— small function and pipeline helpers.aivi.arithmetic— compiler-backed integer arithmetic intrinsics.aivi.bits— compiler-backed bitwise integer intrinsics.
Numbers, text, and data
aivi.math— everyday arithmetic helpers.aivi.core.float— floating-point numbers.aivi.bigint— integers that can grow past the normalIntrange.aivi.text— text helpers.aivi.regex— regular-expression matching and replacement.aivi.core.bytes— byte buffers.aivi.data.json— JSON text helpers plus structural JSON types.
Time, randomness, and scheduling
aivi.duration— typed time spans such as5sec.aivi.time— clocks, timestamps, and duration arithmetic.aivi.date— calendar data types and pure formatting.aivi.timer— marker types for timer-backed signals.aivi.random— randomness vocabulary plusRandomSource.
Files, environment, and processes
aivi.fs— filesystem vocabulary plusFsSource.aivi.path— lexical path helpers plus the nominalPathvocabulary type.aivi.env— environment vocabulary plusEnvSource.aivi.stdio— stdio vocabulary plusStdioSource.aivi.log— logging vocabulary plusLogSource.aivi.process— process vocabulary plusProcessSourcecapabilities.
Network and services
Some modules in this group are full helpers, and some are shared data shapes for integrations. The linked pages spell out which functions exist today.
aivi.url— validated, normalized URLs and their text representation.aivi.http— HTTP vocabulary plusHttpSource.aivi.api— auth and error vocabulary shared by@source api.aivi.auth— OAuth / PKCE sign-in records and state types.aivi.db— database vocabulary plusDbSource.aivi.imap— mailbox records used by the built-in IMAP sources.aivi.smtp— outgoing mail settings, messages, and errors.
Desktop, UI, and GNOME
Many pages in this group describe handle vocabularies, watcher/source shapes, partial runtime surfaces, or shared desktop data types rather than a full feature API. They are still the right place to look when wiring a Linux desktop app together.
aivi.desktop.xdg— XDG error vocabulary; actual directories come fromPathSource.aivi.portal— desktop portal results and built-in sources for file picking, opening URIs, and screenshots.aivi.dbus— D-Bus vocabulary plusDbusSource.aivi.gnome.settings— GSettings schema, key, and value types.aivi.secret— desktop keyring capabilities.aivi.gnome.tray— the application-side tray bridge.aivi.gnome.onlineAccounts— desktop account and token records.aivi.gnome.notifications— desktop notification payloads, tasks, and response events.aivi.clipboard— clipboard content types and watcher shapes.aivi.color— packed UI colors and channel helpers.aivi.px— pixel dimensions.aivi.gtk.icons— icon-name constants.aivi.gtk.styles— CSS class constants.aivi.image— image data, metadata, and load errors.aivi.gresource— bundled resource paths and load errors.
Common interfaces (typeclasses)
Classes describe operations shared by multiple types. Use the canonical executable-support table for the exact builtin carrier/class matrix, and class laws for semantic contracts. That table distinguishes builtin support from imported authored instances and avoids treating parser acceptance as proof of runtime support.