Module Base.FieldSource

OCaml record field.

Sourcetype ('perm, ('record : any), ('field : any)) t_with_perm =
  1. | Field of ('perm, 'record, 'field) For_generated_code.t

'record is the type of the record. 'field is the type of the values stored in the record field with name name. 'perm is a way of restricting the operations that can be used.

Sourcetype (('record : any), ('field : any)) t = ([ `Read | `Set_and_create ], 'record, 'field) t_with_perm

A record field with no restrictions.

Sourcetype (('record : any), ('field : any)) readonly_t = ([ `Read ], 'record, 'field) t_with_perm

A record that can only be read, because it belongs to a private type.

Sourceval name : (_, _, _) t_with_perm -> string @@ portable
Sourceval get : 'perm ('r : any) ('a : value_or_null). ('perm, 'r, 'a) t_with_perm -> 'r -> 'a @@ portable
Sourceval fset : ('a : value_or_null) ('r : any). ([> `Set_and_create ], 'r, 'a) t_with_perm -> 'r -> 'a -> 'r @@ portable
Sourceval setter : ('a : value_or_null) ('r : any). ([> `Set_and_create ], 'r, 'a) t_with_perm -> ('r -> 'a -> unit) option @@ portable
Sourceval map : ('a : value_or_null) 'r. ([> `Set_and_create ], 'r, 'a) t_with_perm -> 'r -> f:('a -> 'a) @ local -> 'r @@ portable

map and updater can't be polymorphic over 'r, as that requires passing/return any values.

Sourceval updater : ('a : value_or_null) 'r. ([> `Set_and_create ], 'r, 'a) t_with_perm -> ('r -> f:('a -> 'a) @ local -> unit) option @@ portable
Sourcetype ('perm, ('record : any), 'result) user = {
  1. f : 'field. ('perm, 'record, 'field) t_with_perm -> 'result;
}