The standard library’s abstraction vocabulary

The standard library is organized in layers so pure data and algebraic contracts do not depend on effects or a particular backend.

Core layers

Base is the umbrella module loaded by compiler commands and re-exports the supported library surface.

Categorical vocabulary

Categorical defines ordinary library structures such as Category, Arrow, Functor, Applicative, and Monad, with representative instances.

These are not declaration keywords. The language keywords are structure, algebra/trait, and morphism/bridge; categorical names are APIs built with them.

Collections

Collection provides abstractions including folding, sizing, searching, filtering, building, indexing, traversal, sorting, zipping, and slicing. Write constraints for the operation a function needs rather than requiring a concrete container unnecessarily.

Effects and mutable facilities

Effect declares console, file, exception, state, and sequencing contracts plus standard handlers. Mutable supplies explicit references and mutable arrays. Effects remain visible in function types.

Representation, strings, SIMD, and mathematics

Repr contains representation mappings and is separate from semantic reflection. String defines Unicode scalar semantics and the representation- independent Textual algebra; Utf8 supplies the portable validated canonical UTF-8 implementation. Targets may map semantic String to a host string while retaining Utf8 as an ordinary portable type. SIMD defines vector and lane facilities. Mathematical modules cover numeric, linear algebra, statistics, transforms, optimization, and random APIs as their implementations mature.

Backend layer

Backend.LLVM.Native supplies current native intrinsics and handlers. Programs should depend on portable contracts where possible and leave provider selection to target refinement.

Start from the desired operation, find its structure and constraints, then inspect available instances. Avoid importing a large module solely to obtain an unrelated accidental name. Appendix D gives a compact module map; the generated Standard Library reference lists current declarations.

The library evolves, so StandardLibrary.md describes current APIs while the Language Reference remains the authority for syntax.

Common mistakes

Do not mistake categorical API names for language keywords, import an umbrella module merely to obtain one accidental name, or depend directly on a native provider when a portable contract already exists.

Recap

Begin with Core, the relevant algebra or effect, and its instances. Use the generated library reference for exact current declarations and Appendix D for orientation.