summaryrefslogtreecommitdiff
path: root/lib/value/property.mli
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-11-22 13:58:16 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-11-22 13:58:16 +0100
commit056fcabaeec238a7aa927df39a90acea028b1aa0 (patch)
tree3246359561eb2375e85da4537e05a083a1348467 /lib/value/property.mli
parentbc78bea63b7c75e8a9d222dc86fb75ed293a2242 (diff)
Added an option for loading a value content without the multivaluated fields (allow single query)main
Diffstat (limited to 'lib/value/property.mli')
-rw-r--r--lib/value/property.mli33
1 files changed, 33 insertions, 0 deletions
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 *)