Typing Content #1295
cuihtlauac
started this conversation in
General
Typing Content
#1295
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are currently 21 “sorts” of content processed by
ood
.Each sort entails two ocaml types. One corresponds directly to the Yaml stored content (internally named metadata), and the other is the type exposed to the rest of the application (called data). The former is encapsulated inside `Ood, and the latter is exposed to the rest of the application.
Currently, each data type occurs three times:
tool/ood-gen/lib
, one as code, one reified as a stringBranch https://github.com/ocaml/ocaml.org/tree/dedupe-data shows it is possible to make the triplication disappear at the cost of creating an additional internal dependency, giving the dependency diagram a diamond shape. Types at the apex, frontend and packages independent in the middle and web at the bottom. In the current state of the code, this is a no brainer refactoring (the kind which will hopefully be in AI reach soon).
In a second time, to complete phasing out of
ood
, the metadata types need to be handled in an automatized way.Data types are mostly “extensions” of metadata (in the oo-sense). They have additional fields.
Most importantly, additional data fields always functionally depend on metadata field contents.
Identity correspondence:
Functional correspondence:
This suggests usage of a means to express
both expressed as ppx-like attributes. The idea would be to enable expressing something like this:
It may be possible to use https://github.com/andersfugmann/ppx_protocol_conv as a starting point w.r.t. 1.
Beta Was this translation helpful? Give feedback.
All reactions