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

ModuleDescriptionKey exports
aivi.preludeConvenience re-exports and built-in typesValidation, isValid, validationToResult, min, Functor
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.validationAccumulating validation for independent inputsgetOrElse, mapErr, zipValidation, 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 typeentries, merge, combine
aivi.core.setUnordered set for any Eq typesingleton, member, insert, union
aivi.core.rangeInclusive integer range [start, end]start, end, toList, contains
aivi.core.fnHigher-order function combinatorscompose, const, flip, combine
aivi.arithmeticCompiler-backed integer arithmetic intrinsicsadd, sub, mul, div, mod, neg
aivi.orderOrd-driven ordering plus explicit comparator helpersmin, max, minBy, clampBy
aivi.boolBoolean helpersand, or, not, all, any
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 integersparse, plus, times, dividedBy
aivi.textText manipulationlength, contains, trim, split, toUpper
aivi.regexRegular-expression matching and replacementmatches, hasMatch, replaceFirst, allMatches
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.timeClock, timestamp, and formatting helpersnowMs, monotonicMs, format, parse
aivi.timerMarker types for timer-backed signalsimmediate
aivi.randomRandomness vocabulary and RandomSourcerandomInt, randomFloat, randomBytes
aivi.fsFilesystem vocabulary and FsSourcereadText, writeText, deleteFile
aivi.pathLexical path manipulationjoin, basename, dirname, extension
aivi.envEnvironment vocabulary and EnvSourceget, getAll, EnvSource
aivi.stdioStandard I/O vocabulary and StdioSourceStdioSource, StdinLine, stdout
aivi.logLogging vocabulary and LogSourcelevelToText, kv, LogSource
aivi.processProcess vocabulary and ProcessSourcecommand, args, workingDir, env
aivi.urlTyped URLs with explicit parsingparse, scheme, host, path
aivi.httpHTTP vocabulary and HttpSourceHttpSource, Request, Response
aivi.apiOpenAPI capability auth and error vocabularyApiAuth, ApiError, ApiResponse
aivi.authOAuth 2.0 / PKCE sign-in recordsOAuthConfig, OAuthToken, SignInState
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.appApplication framework typesAppLifecycle, AppActionResult, AppCommand
aivi.app.lifecycleLifecycle state, commands, undo, notificationslabel, shortcut, canUndo, NotificationLevel
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 typesmake, parse, GSettingsSource
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 paletteargb, blend, gnomeBlue3, gnomeRed3
aivi.pxPixel dimension domain for type-safe sizingpx, (+), (-), scale, zero
aivi.gtk.stylesAdwaita CSS class name constantssuggestedAction, destructiveAction, classes
aivi.imageImage data, metadata, and load errorsformat, size, bytes, hasAlpha
aivi.gresourceBundled GResource paths and load errorsreadText, readBytes
aivi.i18nInternationalisation marker helperstr, trn

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 time formatting helpers.
  • 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 — checked path values.
  • aivi.env — environment vocabulary plus EnvSource.
  • aivi.stdio — stdio vocabulary plus StdioSource.
  • aivi.log — logging vocabulary plus LogSource.
  • aivi.process — process vocabulary plus future capability shapes.

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 — typed URLs and helpers for their parts.
  • 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 types for current integrations and future source capabilities.
  • 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)

If you have not used typeclasses before, think of them as shared capabilities that different types can implement. The table below describes the current built-in support in the executable language/runtime slice.

InterfaceWhat it gives youBuilt-in support includes
Eq AEquality via == and !=primitive scalars, Ordering, Option, Result, Validation, List
Ord AOrdering via compareInt, Text, Ordering
Default AA fallback value via defaultsame-module Default instances; Option omission via use aivi.defaults (Option); Text / Int / Bool omission via use aivi.defaults (defaultText, defaultInt, defaultBool)
Functor FMapping over a wrapped valueOption, Result, List, Validation, Signal
Semigroup ACombining two values with <>Text, List
Monoid AAn identity value via emptyText, List
Foldable FReducing a structure to one valueList, Option, Result, Validation
Filterable FKeeping some values while dropping othersList, Option
Apply FApplying wrapped functions to wrapped valuesOption, Result, List, Validation, Signal
Applicative FLifting plain values into a context with pureOption, Result, List, Validation, Signal, Task
Monad FChaining context-producing stepsList, Option, Result, Task
Bifunctor FMapping both sides of a two-parameter typeResult, Validation
Traversable FWalking a structure while building effectsList, Option, Result, Validation

This table describes the current executable built-in slice. For the full higher-kinded hierarchy, the canonical executable support reference, and the current imported-unary-instance slice for user-authored higher-kinded classes and instances, see Typeclasses & Higher-Kinded Support.

(c) 2026 by Andreas Herd