Core Data And Results
Current implementation evidence: docs/core-library.html, docs/api.html, and
examples/core-data.0x0.
Representation
The first 0x0 libraries use list-backed conventions for common data shapes:
- Option-like values;
- Result-like values;
- map entries;
- byte lists;
- JSON-field helpers;
- error values;
- safe paths;
- safe file helpers.
These are library conventions, not full algebraic data type syntax.
Tagged Lists
Many library values are represented as lists whose first element is a tag.
Helper functions should hide representation details from callers.
The public API docs generated from doc annotations are the source for function
names and expected behavior.
Result Discipline
Use Result-like helpers when a function can fail in normal operation. Reserve
panic-style behavior for invalid internal states or explicit examples that
document failure behavior.
Practical Rule
When adding a new data convention:
1. create constructor helpers;
2. create predicate/accessor helpers;
3. document the representation in source comments or doc annotations;
4. add a smoke test or example;
5. keep public callers away from raw positional access where practical.