Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Namespace.SSourcetype 'info get = (('a, 'mut) Type_data.getter * 'res) field_action constraint 'info = < x : 'a ; mut : 'mut ; ret : 'res >Aliases for the field types
type 'a field = < x : 'a ; mut : Type_data.imm ; ret : 'a option > gettype 'a mut_field = < x : 'a ; mut : Type_data.mut ; ret : 'a option > gettype 'a exn_field = < x : 'a ; mut : Type_data.imm ; ret : 'a > gettype 'a exn_mut_field = < x : 'a ; mut : Type_data.mut ; ret : 'a > gettype ('param, 't) update = ('param Type_data.updater * 't) field_actionval empty : tThe empty record
val create : (Type_data.only Type_data.const, t) update list -> tCreate a new open record from a list of field updater : create [ field1 ^= value1; field2 ^= value2; ... ] Only const updater make sense in this context, since there is no fields present.
val new_field : unit -> 'ty fieldCreation of a new fields. Note that the type 'ty is weakly polymorphic once the field created. However, in this specific use case, it seems reasonable to annotate the field type by using one of the field type aliases.
val new_field_mut : unit -> 'ty mut_fieldval new_field_exn : unit -> 'ty exn_fieldval new_field_exn_mut : unit -> 'ty exn_mut_fieldval put : < x : 'ty.. > get -> 'ty -> (_ Type_data.const, t) updateConstant field updater: record.%{ field ^= v } sets the value of field to v and is equivalent to record.%{ put field v }
val (^=) : < x : 'ty.. > get -> 'ty -> (_ Type_data.const, t) updateval fmap : < x : 'ty.. > get -> ('ty -> 'ty) -> ('a Type_data.fn, t) updateField map: record.%{field |= f } or record.%{ fmap field f } are equivalent to record.%{ field ^= f record.%{field} } if the field exists, and do nothing otherwise
val (|=) : < x : 'ty.. > get -> ('ty -> 'ty) -> ('a Type_data.fn, t) updateField combinator orec.%{ x & y } is orec.%{x}.%{y}
val (&) :
(Type_data.any, t) update ->
(Type_data.any, t) update ->
(Type_data.any, t) updateval and_then :
(Type_data.any, t) update ->
(Type_data.any, t) update ->
(Type_data.any, t) updateval copy :
< x : 'ty ; mut : Type_data.mut.. > get ->
('a Type_data.fn, t) updateCopy a mutable field
val delete : < .. > get -> ('a Type_data.del, t) updateDelete a field, if the field does not exist, do nothing
val update : (Type_data.any, t) update -> t -> tval set : < x : 'ty ; mut : Type_data.mut.. > get -> 'ty -> t -> unitOperator version of get+update and set
val (.%{}) : t -> (_ * 'ret) field_action -> 'ret(.%{} ) operator:
record.%{field} returns the value of the fieldrecord.%{field ^= value} returns a functional update of record record.%{field |= f} is equivalent to record.{ field ^= f record.{field} } record.%{delete field} returns an updated version of record without this fieldval (.%{}<-) : t -> < x : 'ty ; mut : Type_data.mut.. > get -> 'ty -> unitval transmute :
(< x : 'a ; mut : 'm.. > as 'x) get ->
('a, 'b) bijection ->
< x : 'b ; mut : 'm ; ret : 'b option > getUse the type equality implied by the bijection 'a⟺'b to create a new 'b field getter from an 'a field getter. The new field getter uses option access
val (@:) :
(< x : 'a ; mut : 'm.. > as 'x) get ->
('a, 'b) bijection ->
< x : 'b ; mut : 'm ; ret : 'b option > getOperator version of transmute