From e1bf7686f408b52a870d4ed4f3c565dbbcc3954f Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Thu, 19 Nov 2026 09:57:49 +0100 Subject: Management of lists in the settings --- lib/model/reference.ml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/model/reference.ml') 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 -- cgit v1.2.3