Standard library
The compiler repository ships the standard library in libs/std. It is a normal Ligare library package with compiler-intrinsic declarations in std::primitive.
Set LIGARE_STD_PATH to the directory containing src/lib.lig when using an installed or relocated compiler:
bash
export LIGARE_STD_PATH="/absolute/path/to/ligare/libs/std"Public modules
| Module | Main contents |
|---|---|
| std::io | put_str, print_line, read_char_code, and IO combinators. |
| std::fmt | The Display constraint plus display and to_string. |
| std::string | Basic string construction, concatenation, and repetition. |
| std::data::bool | Boolean operations and selection. |
| std::data::nat | The Nat struct and arithmetic/order helpers. |
| std::data::order | The Ordering enum. |
| std::data::product | Generic Pair and Either values. |
| std::mem::list | Generic lists and traversal helpers. |
| std::mem::vec | Length-indexed vectors. |
| std::option | Generic optional values and combinators. |
| std::result | Generic success/error values and combinators. |
| std::ops | Operator and conversion constraints. |
| std::prelude | Commonly used standard-library exports. |
| std::meta | Attributes and compile-time syntax support. |
Primitive declarations
std::primitive declares compiler-provided constraints and operations such as int, bool, str, IO, ptr, arithmetic, comparisons, and string concatenation. These declarations are visible in the standard library so the compiler's intrinsic surface has a source-level home.
Example
ligare
use std::data::nat::Nat
use std::io::print_line
pub def main : IO () :=
do
let value : Nat := succ Nat::zero
print_line valueThe library is still evolving. The compiler source and libs/std/src are the authoritative references for available names and signatures.