A Rust implementation of Categorical Configuration Language - a minimal configuration language where configs form a monoid under concatenation, parse/pretty-print operations are monoid homomorphisms (enabling provably correct parallel parsing), and together form an isomorphism (enabling lossless round-trips).
| Property | Definition | In CCL Terms | Implication |
|---|---|---|---|
| Associativity (Semigroup) prop-test |
(a ⊕ b) ⊕ c = a ⊕ (b ⊕ c) |
(default + user) + project = default + (user + project) |
Composing multiple configs is worry-free |
| Left/Right Identity (Monoid) prop-test |
empty ⊕ a = aa ⊕ empty = a |
- empty + config = config- config + empty = config |
Missing configs are valid |
| Monoid Homomorphism (structure-preserving map) |
f(a ⊕ b) = f(a) ⊗ f(b)f(empty) = empty |
- parse(file1 ^ file2) = parse(file1) @ parse(file2)- parse("") = []- pretty(list1 @ list2) = pretty(list1) ^ pretty(list2)- pretty([]) = "" |
Parallel processing; incremental updates |
| Monoid Isomorphism (two-way structure preservation) prop-test |
f ∘ g = idg ∘ f = id |
- pretty(parse(config_text)) = config_text- parse(pretty(key_vals)) = key_vals |
Serialization is lossless |
See CLI tests for examples