Skip to Content
i documentation
Standard library reference

Standard library reference

Browse the modules supplied by i and the std package.

The library reference describes the modules in std and i/…. Select a module to find its exports and source documentation. The i/… modules are supplied with the compiler; std is a separate package.

To use std in a project, put its checkout path in i.toml under [dependencies], as in std = { path = "../std" }; the path is relative to the package. For tests only, the starter project uses [dev-dependencies]. The generated reference pages take module introductions from //// comments and export documentation from /// comments. When a checked type is available, the generator includes it; otherwise it uses the source declaration.

std modules

ModulePurpose
std/bit_arrayFunctions for BitArray, the type of lists of bits
std/boolFunctions for the built-in type Bool { True False }
std/calendarProleptic Gregorian dates for all integer years, and explicit fixed offsets
std/cliPure command argument descriptions with typed results
std/cryptoSHA-2 digests and key derivation in ordinary immutable i
std/csvStrict CSV rows, following RFC 4180 and Go encoding/csv
std/dictDictionaries: maps from keys to values that may not be changed
std/floatFunctions for Float, the type of finite IEEE 754 binary64 numbers
std/httpHTTP/1.1 messages, incremental framing, clients and scoped servers
std/intFunctions for Int, the type of whole numbers of any size
std/jsonJSON values and RFC 8259 text encoding. Offsets are UTF-8 byte offsets
std/listFunctions for immutable lists
std/logStructured entries and call-time sink services. See std-2.md §6/§7
std/optionOptional values, represented by Some(value) or None
std/orderThe result of comparing two values, and functions to work with it
std/pairFunctions for tuples of two parts, (a, b)
std/pathLexical POSIX paths using / as the separator
std/propertyReproducible pure generators with lazy, ordered shrink trees
std/regexUnicode scalar regular expressions: ordered Thompson NFA / PikeVM
std/resultFunctions for the built-in type Result(A, E) { Ok(A) Error(E) }
std/schemaComposable two-way JSON codecs
std/sequenceFinite persistent indexed deques
std/setImmutable sets of distinct values
std/streamReplayable pull streams
std/stringFunctions for strings of Unicode scalar values
std/timeExact nanosecond durations and Unix epoch instants
std/uriStrict ASCII RFC 3986 references, stored with their original encoded spelling

i modules

ModulePurpose
i/assertionTaking Assert failures (§9.6)
i/bigArbitrary precision Int arithmetic beyond the small range (§11.2)
i/bitsInteger segments of bit arrays (§8.3, §8.4) that do not fit 63 bits
i/clockClock observations and scheduler-friendly sleeps
i/controlOne operation to pause a computation and go on with it later (§9.4)
i/coreThe operations that are not written in i (§13)
i/failErrors (§9.3)
i/failureErrors as a service (§9.3)
i/fetchFetch transport. Response handles belong to the current resource context
i/float_textThe text form of a Float (§11.8)
i/fsFile system operations
i/ioThe standard Io service (§9.7)
i/keyTyped keys for heterogeneous immutable values (§9.8)
i/netTCP streams, UDP datagrams and name resolution
i/processProcess capabilities and secure entropy
i/randomPure, immutable SplitMix generators (§9.10)
i/requestTyped requests, cancellation groups and replaceable waits (§9.11)
i/resourceFinal functions (§9.5)
i/stdioByte-oriented standard streams
i/syntaxSource syntax values for compile-time programs and tests
i/taskStructured tasks, rendezvous channels and events (§9.9)
i/tlsTLS on connected byte streams

See also

Library modules and packages · The language standard