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]
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 and lattice_sets 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_mapWhich 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 everything.
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_countersSee Installation for full details.