summaryrefslogtreecommitdiff
path: root/lib/model/typ.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/model/typ.ml')
-rw-r--r--lib/model/typ.ml24
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/model/typ.ml b/lib/model/typ.ml
index 9427b86..6168c4c 100644
--- a/lib/model/typ.ml
+++ b/lib/model/typ.ml
@@ -1,33 +1,19 @@
-(** The target of a reference field: either a content or a static list.
-
- Only the content side is parameterized: this module cannot depend on
- [Reference] (module cycle through [Content] and [Field]), whereas [List]
- only depends on [Identifier] and can be fixed here. At the resolved level
- (see {!Model.target}) ['c = Reference.t]. *)
-type 'c target =
- | Content of 'c
- | List of List.t
-
type 'a reference = {
t : 'a;
- (** The target of the reference: a {!target} at the resolved level. *)
+ (** The target of the reference: at the resolved level a
+ {!Reference.target} (aliased as {!Model.target}). *)
constraints : string list Dsl.t option;
(** Optionally restrict the values allowed for this field, as a DSL
expression read from the optional ["constraints"] key of the
configuration. Currently carried through to the consumers (e.g. to
filter the proposed values); [None] means no restriction. *)
}
-(** A reference from a field to a content.
-
- The target [t] is a {!Model.Reference.t}: a lazy pointer to the content,
- created while the configuration is parsed (see [Configuration.Read_conf])
- and resolved once all the contents are registered. The laziness is what
- allows contents to reference each other cyclically.
+(** A reference from a field to a target (a content or a static list).
The type stays parameterized over ['a] only to break the module dependency
cycle ([Reference] depends on [Content], which depends on [Field]/[Typ]); in
- practice ['a] is always [Model.Reference.t]. Use the aliases
- [Model.reference], [Model.content], [Model.field], ... at the use sites. *)
+ practice ['a] is always {!Model.target}. Use the aliases [Model.reference],
+ [Model.content], [Model.field], ... at the use sites. *)
(** Each of the field types available in the application.