Skip to content

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 shapeWhat the top tables showTypical examples
Pure helper moduleThe full exported function battery for the moduleaivi.option, aivi.result, aivi.list, aivi.math, aivi.bool
Vocabulary / capability moduleThe exported types, handles, and canonical membersaivi.fs, aivi.http, aivi.db, aivi.env
Mixed moduleSeparate tables for core operations and higher-level helpersaivi.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 ​

ModuleDescriptionSelected exports or capability members
aivi.preludeBuilt-in types, classes, and generic orderingValidation, Functor, min, max, clamp
aivi.asyncAsync operation lifecycle trackerAsyncTracker, step, isPending, isDone, isFailed
aivi.optionValues that may be missinggetOrElse, map, flatMap, toResult
aivi.resultSuccess-or-error valueswithDefault, map, mapErr, flatMap
aivi.validationValidation conversions and combinatorsgetOrElse, mapErr, andThen, fold
aivi.core.eitherDisjoint union holding one of two alternativesLeft, Right, mapLeft, mapRight
aivi.listPurely functional list operationsmap, filter, maximum, unique, sort
aivi.nonEmptyNon-empty list guaranteed at the type levelhead, last, singleton, cons, fromList
aivi.pairTwo-element tuplesfirst, second, mapFirst, mapSecond
aivi.matrixRectangular 2D collectionsinit, fromRows, width, height, rows
aivi.core.dictAssociation map keyed by any Eq typeDict, get, insertWith, fromList
aivi.core.setUnordered set for any Eq typesingleton, member, insert, fromList
aivi.core.rangeInclusive integer range [start, end]RangeInt, make, length, contains
aivi.core.fnHigher-order function combinatorscompose, const, flip, on
aivi.arithmeticCompiler-backed integer arithmetic intrinsicsadd, sub, mul, div, mod, neg
aivi.orderOrd-driven ordering plus explicit comparator helpersmin, max, minBy, clampBy
aivi.boolBoolean helpersboth, either, not, xor
aivi.bitsCompiler-backed bitwise integer intrinsicsand, or, xor, not, shiftLeft
aivi.defaultsDefault values for common typesdefaultText, defaultInt, defaultBool
aivi.mathInteger arithmetic utilitiesabs, clamp, min, max, gcd
aivi.core.floatIEEE 754 double-precision helpersfloor, ceil, round, sqrt, pi
aivi.bigintArbitrary-size integersfromText, add, mul, div
aivi.textText manipulationlength, contains, trim, split, toUpper
aivi.regexRegular-expression matching and replacementisMatch, findText, replace, findAll
aivi.core.bytesByte sequence operationsfromText, toText, slice, append
aivi.data.jsonJSON text helpers plus structural JSON typesvalidate, get, pretty, Json
aivi.durationTyped time spansms, sec, min, hr, millis
aivi.timeClocks, timestamps, and duration arithmeticnowMs, monotonicMs, toSeconds, elapsed
aivi.dateCalendar data and pure formattingDate, TimeOfDay, DateDelta, dateToIso
aivi.timerMarker types for timer-backed signalsTimerTick, TimerReady, TimerMode
aivi.randomRandomness vocabulary and RandomSourceRandomSource, RandomError
aivi.fsFilesystem vocabulary and FsSourceFsSource, FsError, FsEvent
aivi.pathPure lexical path operations on Textjoin, filename, parent, extension
aivi.envEnvironment vocabulary and EnvSourceEnvSource, EnvEntry
aivi.stdioStandard I/O vocabulary and StdioSourceStdioSource, Stream, Stdout, Stderr
aivi.logLogging vocabulary and LogSourcelevelToText, kv, LogSource
aivi.processProcess vocabulary and ProcessSourcecommand, args, workingDir, env
aivi.urlTyped URLs with explicit parsingUrl, UrlError, parse, toText
aivi.httpHTTP vocabulary and HttpSourceHttpSource, HttpResponse, HttpError
aivi.apiOpenAPI capability auth and error vocabularyApiAuth, ApiError, ApiResponse
aivi.authOAuth 2.0 / PKCE sign-in recordsPkceConfig, PkceToken, PkceState
aivi.dbDatabase vocabulary and DbSourcequery, commit, DbSource
aivi.imapMailbox and folder types for IMAP integrationsFolderSummary, MailEvent, lastSyncedAt
aivi.smtpOutgoing mail configuration and messagesfrom, to, subject, bodyText, SmtpConfig
aivi.desktop.xdgXDG error vocabularydataHome, configHome, cacheHome
aivi.portalDesktop portal result vocabulary plus built-in portal sourcesopenFile, openUri, screenshot
aivi.dbusD-Bus vocabulary and DbusSourcedestination, path, interface, member
aivi.gnome.trayGNOME tray bridge vocabularyTraySource, defaultPath, actionMember
aivi.gnome.settingsGSettings schema, key, and value typesSettingsSchema, SettingsKey, SettingValue
aivi.gnome.onlineAccountsDesktop account and token recordsid, token, tokenType, expiresAt
aivi.gnome.notificationsDesktop notification capability vocabularyNotificationSource, NotificationTask, NotificationEvent
aivi.clipboardClipboard content types and watcher shapesClipboardContent, ClipboardSource
aivi.colorPacked ARGB color domain with blend and GNOME paletteColor, blend, gnomeBlue3, gnomeRed3
aivi.pxPixel dimension domain for type-safe sizingpx, addPx, subPx, scalePx, zero
aivi.gtk.stylesAdwaita CSS class name constantssuggestedAction, destructiveAction, classes
aivi.gtk.iconsIcon-name text constantsdocumentOpen, documentSave, goHomeSymbolic
aivi.secretDesktop keyring capability vocabularySecretSource, SecretError, SecretTask
aivi.imageImage data, metadata, and load errorsformat, size, bytes, hasAlpha
aivi.gresourceBundled GResource paths and load errorsResourcePath, ResourceError, ResourceTask

Built-in types you will see often ​

TypeMeaningMore
OrderingThe result of comparing two values: Less, Equal, or Greater.aivi.order
Option AA value that may be missing.aivi.option
Result E AA success value (Ok) or a failure value (Err).aivi.result
Validation E ALike Result, but useful when checking several independent inputs.aivi.validation
Signal AA reactive value that changes over time.Signals guide
Task E ARuntime 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 ​

Numbers, text, and data ​

Time, randomness, and scheduling ​

  • aivi.duration — typed time spans such as 5sec.
  • 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 plus RandomSource.

Files, environment, and processes ​

  • aivi.fs — filesystem vocabulary plus FsSource.
  • aivi.path — lexical path helpers plus the nominal Path vocabulary type.
  • aivi.env — environment vocabulary plus EnvSource.
  • aivi.stdio — stdio vocabulary plus StdioSource.
  • aivi.log — logging vocabulary plus LogSource.
  • aivi.process — process vocabulary plus ProcessSource capabilities.

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 plus HttpSource.
  • aivi.api — auth and error vocabulary shared by @source api.
  • aivi.auth — OAuth / PKCE sign-in records and state types.
  • aivi.db — database vocabulary plus DbSource.
  • 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.

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.

(c) 2026 by Andreas Herd