Add a formal notion of group
My design idea is the following:
The combinator group : Group.t -> 'a impl -> 'a impl would take an implementation and bundle it in the given group. It needs to copy the underlying implementation (to handle things like let a = group g x in let b = group g y in ...).
We have Group.t = { prefix : string ; name : string }, prefix is for the keys.
This would allow to
- Prefix automatically all the subkeys in an implementation
- Improve documentation by using graphviz's subgraph property.
I'm not completely sure how to implement that just yet. The interaction with sharing in particular is a bit tricky. This is emulated in mirage, which prove that it's very desirable.
This feature is starting to get more desirable for more than just keys.
Currently we have the following constructs:
- A configurable, with some dependencies and keys.
- If
- Application
This doesn't allow encoding various things cleanly, such as
- Wrapping around a device.
- Specifying dependencies to/from a group of devices.
I think the grouping could also solve those issues, by allowing to specify dependencies to a group of device directly.