Package Structure
lattice is organized as a family of focused packages. Each package covers one
category of CRDTs. You can depend on the umbrella lattice_crdt for everything,
or pick individual packages for minimal dependencies.
Packages
Section titled “Packages”Dependencies
Section titled “Dependencies”graph BT
core[lattice_core]
counters[lattice_counters]
registers[lattice_registers]
sets[lattice_sets]
maps[lattice_maps]
presence[lattice_presence]
crdt[lattice_crdt]
registers --> core
maps --> core
maps --> counters
maps --> registers
maps --> sets
crdt --> core
crdt --> counters
crdt --> registers
crdt --> sets
crdt --> maps
lattice_counters, lattice_sets, and lattice_presence have no lattice
dependencies beyond gleam_stdlib and gleam_json, making them the lightest
packages to depend on.
Import paths
Section titled “Import paths”In Gleam, imports come from the package name. Even when you install the umbrella
lattice_crdt, you import from the sub-package names:
import lattice_core/replica_idimport lattice_counters/g_counterimport lattice_sets/or_setimport lattice_maps/or_mapimport lattice_presence/presence_stateWhich approach to choose
Section titled “Which approach to choose”Start with lattice_crdt if you are getting started, prototyping, or using
CRDTs from multiple categories. One dependency gives you the core CRDTs.
Pick individual packages when binary size or dependency count matters, or when you only need one category of CRDT. For example, if you only need counters:
gleam add lattice_countersAdd lattice_presence separately when you need distributed presence tracking;
it is intentionally independent of the lattice_crdt umbrella package.
See Installation for full details.