Project layout
The package manager uses a small, Cargo-like directory layout:
hello/
├── ligare.toml
├── src/
│ ├── main.lig
│ └── math.lig
└── tests/
└── arithmetic_test.ligBinary packages use src/main.lig by default. The entry file must define a public main computation:
pub def main : IO () := ()Library packages use src/lib.lig by default and do not require main. Specify type = binary or type = lib when the package type should be explicit.
The manifest
[package]
name = "hello"
version = "0.1.0"
type = "binary"
[dependencies]
mathlib = { path = "../mathlib" }The entry field can select another source file. Dependencies may use a local path or a Git URL, with an optional version, tag, or commit selector. Dependency resolution writes ligare.lock.
Modules
Source modules are declared in the entry module and are mapped to files:
mod math
use math::add
pub def main : IO () :=
let _ = add 1 2 in ()The corresponding src/math.lig can contain:
pub def add (left right : int) : int := left + rightOnly public definitions and modules can be imported by another module or package. The Modules page explains nested modules and imports.
Tests
ligare test recursively finds source files whose names end in _test.lig and checks them as package entries. Keep executable entry points in src/main.lig; test files are for compile-time checks and regression coverage.