Standard Library
Standard Library
Standard Library
Zirric’s standard library is written in Zirric. Every page here mirrors the module’s own sources — the signatures, doc comments and line references come from the .zirr files the compiler reads.
prelude is in scope everywhere and needs no import. Everything else is imported by name:
import strings
import tests.runner
import pkgs = reflect.packages
Experimental
ZE-020 Standard Library landed in v0.1.0. These modules are usable today, but names and signatures can still change.
Core
The types every program is built from, and the two unions the rest of the library returns.
prelude— built-in types, the attributes that describe them,OptionandResult.options— working with values that may be absent.results— working with values that may have failed.errors— combining, annotating and unwrapping error values.
Data
arrays— slicing, searching and transformingArray.dicts— mapping, filtering and reducingDict.strings— text operations that count characters, not bytes.bytes— rawBinaryvalues and the conversions into them.ranges— set operations over the three range types.math— numeric constants, conversions and rounding.fun— function combinators, and lazy operations over anything iterable.
The outside world
os— the only module that talks to the machine.io— the reader and writer attributes, and the streams that carry bytes.fmt— turning values into strings and writing them out.fs— files and directories, as a value you pass around.paths— joining, cleaning and matching path strings.clock— wall-clock and monotonic time, as values a test can replace.time— durations, instants and timestamps.random— seeded randomness, and the operations every source shares.scripts— the printing and file helpers, already wired to the host. A package of its own: depend on it to use it.
Serialization
coding— between your own types and a native value tree.json— reading and writing JSON.yaml— reading and writing YAML.
Reflection
reflect— inspecting modules, types, fields and values at runtime.reflect.packages— discovering the modules of the running package.
Testing
tests— the attributes and types that describe a test.tests.assert— assertions that produce theResulta test returns.tests.runner— discovery and execution.tests.tap— TAP output.
Project manifests
Both of these are the vocabulary a Cavefile is written in rather than modules you import into a program. See Cavefile manifests for a whole file.
Future
Implementations of proposals that have not landed. They may change or disappear.
future— what the module is and how to treat it.future.prelude— proposed prelude additions.future.reflect— the original reflection sketch, superseded byreflect.