atom option in gen/common/edge.ml is currently used to represent the "plain annotation" P. I personally find there's room for improvement, for a couple of reasons:
- One would expect the value
None : atom option to represent "absence of annotation", or a failure state, but it doesn't. This is particularly counter-intuitive (IMO) when looking at the signature of functions like parse_atom : string -> atom option and incorrectly expecting atom option to represent "failure to parse".
- The semantics of
P itself makes it more similar to a wildcard. P makes the annotated access plain by default, but does not enforce this property. Indeed, merging P with any non-P atom a equals a, so P really stands for "plain unless specified otherwise". I think it would be useful to also be able to express scenarios where a diy edge endpoint must be plain, and not just "plain unless specified otherwise".
To address both issues, I propose we:
- extend
atom with a constructor to represent the P annotation, removing the need for atom option. P's behaviour as a "wildcard"/"default annotation" can be preserved by modifying the edge/atom merging functions accordingly. This will also make atom more in like with sd, ie, etc., all of which also define their own wildcard constructors.
- further extend
atom with a completely new constructor to represent accesses that must be plain.
The can (and probably, should) address these two points in two separate PRs.
See original discussion here. CC @ShaleXIONG
atom optioningen/common/edge.mlis currently used to represent the "plain annotation"P. I personally find there's room for improvement, for a couple of reasons:None : atom optionto represent "absence of annotation", or a failure state, but it doesn't. This is particularly counter-intuitive (IMO) when looking at the signature of functions likeparse_atom : string -> atom optionand incorrectly expectingatom optionto represent "failure to parse".Pitself makes it more similar to a wildcard.Pmakes the annotated access plain by default, but does not enforce this property. Indeed, mergingPwith any non-Patomaequalsa, soPreally stands for "plain unless specified otherwise". I think it would be useful to also be able to express scenarios where adiyedge endpoint must be plain, and not just "plain unless specified otherwise".To address both issues, I propose we:
atomwith a constructor to represent thePannotation, removing the need foratom option.P's behaviour as a "wildcard"/"default annotation" can be preserved by modifying the edge/atom merging functions accordingly. This will also makeatommore in like withsd,ie, etc., all of which also define their own wildcard constructors.atomwith a completely new constructor to represent accesses that must be plain.The can (and probably, should) address these two points in two separate PRs.
See original discussion here. CC @ShaleXIONG