Skip to content

Standard Library

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.

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.

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.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
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, support boundaries, and the current same-module-only limits for user-authored higher-kinded classes and instances, see Typeclasses & Higher-Kinded Support.

AIVI Language Manual