From 056fcabaeec238a7aa927df39a90acea028b1aa0 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 22 Nov 2026 13:58:16 +0100 Subject: Added an option for loading a value content without the multivaluated fields (allow single query) --- lib/value/property.mli | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/value/property.mli (limited to 'lib/value/property.mli') diff --git a/lib/value/property.mli b/lib/value/property.mli new file mode 100644 index 0000000..af83dc0 --- /dev/null +++ b/lib/value/property.mli @@ -0,0 +1,33 @@ +(** A property of a value: a field name tied to its type. + + A property is the typed handle used to read a field of a value with + {!Value.get}: the {!Model.Types.t} of the field together with its + {!Model.Identifier.t} name. *) + +type 'typ t = { + name : Model.Identifier.t; (** The internal name of the field *) + typ : 'typ; (** The type of the field, e.g. a ['target multireference] *) +} +(** A {!Model.Types.t} together with the field's name *) + +val named : name:Model.Identifier.t -> typ:'typ -> 'typ t +(** Build a property from a name and a type — no uniqueness involved, so values + built on the fly denote the same field *) + +val name : 'typ t -> Model.Identifier.t +(** The name of the field *) + +val typ : 'typ t -> 'typ +(** The type of the field *) + +val provably_equal : + ('a, 'x, 'c) Model.Types.t t -> + ('b, 'y, 'c) Model.Types.t t -> + ('x, 'y) Type.eq option +(** [provably_equal p1 p2] is [Some Equal] iff [p1] and [p2] denote the same + field — same name — and their types match, which also proves that their + ['ocaml] representations are equal *) + +val same : ('a, 'x, 'c) Model.Types.t t -> ('b, 'y, 'c) Model.Types.t t -> bool +(** [same p1 p2] is [true] iff [p1] and [p2] denote the same field with matching + types *) -- cgit v1.2.3