diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-11-22 13:58:16 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-11-22 13:58:16 +0100 |
| commit | 056fcabaeec238a7aa927df39a90acea028b1aa0 (patch) | |
| tree | 3246359561eb2375e85da4537e05a083a1348467 /lib/model/types.mli | |
| parent | bc78bea63b7c75e8a9d222dc86fb75ed293a2242 (diff) | |
Added an option for loading a value content without the multivaluated fields (allow single query)main
Diffstat (limited to 'lib/model/types.mli')
| -rw-r--r-- | lib/model/types.mli | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/lib/model/types.mli b/lib/model/types.mli index 81c9d5b..12f9c79 100644 --- a/lib/model/types.mli +++ b/lib/model/types.mli @@ -50,43 +50,10 @@ type 'target multireference = (int64, int64 Seq.t, 'target) t val default_value : ('a, 'b, 'c) t -> 'a (** The value to insert in the database when the field is empty *) -val eq : ('a, 'x, 'c) t -> ('b, 'y, 'c) t -> ('a, 'b) Type.eq option -(** Constructor-level equality on the ['db] representation: [eq t1 t2] is - [Some Equal] when [t1] and [t2] have the same constructor, which also proves - ['a = 'b] *) +val eq : ('a, 'x, 'c) t -> ('b, 'y, 'c) t -> ('a * 'x, 'b * 'y) Type.eq option +(** Constructor-level equality: [eq t1 t2] is [Some Equal] when [t1] and [t2] + have the same constructor. -val eq_ocaml : ('a, 'x, 'c) t -> ('b, 'y, 'c) t -> ('x, 'y) Type.eq option -(** Constructor-level equality on the ['ocaml] representation: [eq_ocaml t1 t2] - is [Some Equal] when [t1] and [t2] have the same constructor, which also - proves ['x = 'y] *) - -type 'typ named = { - name : Identifier.t; (** The internal name of the field *) - typ : 'typ; (** The type of the field, e.g. a ['target multireference] *) -} -(** A named field type: a {!t} together with the field's name. - - Named types are built on the fly with {!named} (e.g. from a field, see - {!Field.named_of}) and used locally as typed handles — e.g. to read the data - of a field from a value. A pre-built instance exists for the reserved field - ["id"] (see [Value.id_ref]). *) - -val named : name:Identifier.t -> typ:'typ -> 'typ named -(** Build a named type from a name and a type — no uniqueness involved, so - values built on the fly denote the same field *) - -val name : 'typ named -> Identifier.t -(** The name of the field *) - -val typ : 'typ named -> 'typ -(** The type of the named field *) - -val provably_equal : - ('a, 'x, 'c) t named -> ('b, 'y, 'c) t named -> ('x, 'y) Type.eq option -(** [provably_equal n1 n2] is [Some Equal] iff [n1] and [n2] denote the same - field — same name — and their types match, which also proves that their - ['ocaml] representations are equal *) - -val same : ('a, 'x, 'c) t named -> ('b, 'y, 'c) t named -> bool -(** [same n1 n2] is [true] iff [n1] and [n2] denote the same field with matching - types *) + Since the pair type is injective, [Equal] proves at once that ['a = 'b] (the + database representations match) and ['x = 'y] (the code representations + match). *) |
