summaryrefslogtreecommitdiff
path: root/lib/model/reference.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-11-19 09:57:49 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-11-19 09:57:49 +0100
commite1bf7686f408b52a870d4ed4f3c565dbbcc3954f (patch)
treeee7e156032cc0c43ca10879051e64c3dfeab1515 /lib/model/reference.ml
parenta9628fda0fc027c54b5ed5313a0c41731d79e41f (diff)
Management of lists in the settings
Diffstat (limited to 'lib/model/reference.ml')
-rw-r--r--lib/model/reference.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/model/reference.ml b/lib/model/reference.ml
index 496eb9d..67bbcaf 100644
--- a/lib/model/reference.ml
+++ b/lib/model/reference.ml
@@ -1,4 +1,11 @@
-type t = T : t Content.t Lazy.t -> t [@@unboxed]
+(** A lazy pointer to a resolved content. The payload is
+ [t Typ.target Content.t] — i.e. {!Model.content} — and is only forced once
+ every content has been registered (see [Configuration.Ast.check]), which
+ is what allows cyclic references between contents. *)
+type t = T : t Typ.target Content.t Lazy.t -> t [@@unboxed]
-let v : (unit -> t Content.t) -> t = fun f -> T (lazy (f ()))
-let get : t -> t Content.t = fun (T target) -> Lazy.force target
+let v : (unit -> t Typ.target Content.t) -> t =
+ fun f -> T (lazy (f ()))
+
+let get : t -> t Typ.target Content.t = fun (T target) ->
+ Lazy.force target