From 172a02b80d8dbdcfe09129d7fa76015bb5ec4d79 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 20 Nov 2026 18:57:38 +0100 Subject: Refactoring --- lib/model/field.mli | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/model/field.mli') 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 -> -- cgit v1.2.3