Gist.FieldFields.
The field type represents an individual field of a Product.t value which is used to represent tuple types, record types and variant cases types.
Fields are named only for record types or variant case types with inline records.
type name = Gist.nameThe type for record field names. These must be unqualified. For example for Stdlib.Complex, re, im, see also name. An empty string indicates the field is unnamed.
val make :
?name:name ->
?doc:string ->
?meta:('p, 'v) Meta.t2 ->
?set:('p -> 'v -> unit) ->
?iset:('p -> 'v -> 'p) ->
'v gist ->
('p -> 'v) ->
('p, 'v) tmake g get is a field such that:
g is the type representation of the field.get is the function to get the field value from the product.name is the name for the field. Defaults to "".doc is the doc string for the field. Defaults to "".meta is the field metadata. Defaults to Meta.empty.set is a function to update the field value of the product in-place for mutable record fields. Defaults to None, that is the field is immutable.iset is a function for an immutable update of the field value of the product. Defaults to None.val doc : ('p, 'v) t -> stringdoc f is the doc string of f.
val get : ('p, 'v) t -> 'p -> 'vget f is the function to get the field value from the product.
val set : ('p, 'v) t -> ('p -> 'v -> unit) optionset f is a function to update the field value of the product in-place, if any. This is only relevant for record fields.
val iset : ('p, 'v) t -> ('p -> 'v -> 'p) optioniset f is a function for an immutable update of the field value of the product, if any.
val is_mutable : ('p, 'v) t -> boolis_mutable f is true if and only if set f is Some _.