# `nsys` design doc

## Conventions

'Variant' -- newtype enum

'Kind' -- variant tag or newtype conversion trait

'Id', 'Key', 'Index'

- Id    -- unique identifier, could be composite
- Key   -- a newtype wrapper for a smaller primint index, otherwise another map
  key type (e.g. a hashable instance)
- Index -- a usize or smaller primint type

num_X -- specifies the total number of something

X_count -- counts occurrences of something

Constructors:

- `fn default() -> Self` -- no params, can't fail
- `fn new (...) -> Option <Self>` -- safe constructor
- `fn noisy (...) -> Self` -- runtime assertion if constraints are violated
- `fn unchecked (...) -> Self` -- debug assertion if constraints are violated
