summaryrefslogtreecommitdiff
path: root/lib/model/field.mli
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-11-20 18:57:38 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-11-20 18:57:38 +0100
commit172a02b80d8dbdcfe09129d7fa76015bb5ec4d79 (patch)
treecb8613d53ce8051e39937ff05f8dc9b0fe80320e /lib/model/field.mli
parentfa4970bf1b74f3fa0b2f63cbd461d98c251dc0f0 (diff)
Refactoring
Diffstat (limited to 'lib/model/field.mli')
-rw-r--r--lib/model/field.mli9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/model/field.mli b/lib/model/field.mli
index caa7b26..0619f33 100644
--- a/lib/model/field.mli
+++ b/lib/model/field.mli
@@ -2,11 +2,18 @@ type textI18n = (string * string) list
(** A label is just an association list*)
type validation = { rule : string list Dsl.t; message : textI18n }
-type 't field_ex = T : ('a, 't) Typ.t -> 't field_ex
+type 't field_ex = T : ('db, 'ocaml, 't) Typ.t -> 't field_ex
type 'ref t
(** Description of a field *)
+val named_of :
+ 'ref t -> ('db, 'ocaml, 'ref) Typ.t -> (('db, 'ocaml, 'ref) Typ.t) Typ.named option
+(** [named_of field typ] is [Some named] — the field's {!Typ.named} type,
+ stamped with ['db] and ['ocaml] — when [typ] matches the declared type of
+ [field] (checked with {!Typ.eq} and {!Typ.eq_ocaml}); [None] on type
+ mismatch *)
+
val create :
'ref field_ex ->
textI18n ->