module Record: sig
.. end
Dynamic records
Layouts
type 's
layout
The representation of record types. 's
is usually a phantom type.
Two interfaces are provided for creating layouts, in Unsafe
and Safe
.
exception ModifyingSealedStruct of string
Raised by field
or seal
if layout has already been sealed.
Records
type 's
t = {
}
The representation of record values.
type 's
content
val get_layout : 'a t -> 'a layout
Get the layout of a record.
exception AllocatingUnsealedStruct of string
Raised by make
when the corresponding layout has not been sealed.
module Type: sig
.. end
Type converters
module Field: sig
.. end
val get : 's t -> ('a, 's) Field.t -> 'a
Get the value of a field.
val set : 's t -> ('a, 's) Field.t -> 'a -> unit
Set the value of a field.
exception UndefinedField of string
Raised by get
if the field was not set.
module Polid: sig
.. end
module Unsafe: sig
.. end
Unsafe interface
module Safe: sig
.. end
Safe interface
Miscellaneous
val to_yojson : 'a t -> Yojson.Safe.json
Convert a record to JSON.
val of_yojson : 'a layout -> Yojson.Safe.json -> ('a t, string) Result.result
Convert a JSON value into a given schema.
module Util: sig
.. end
val equal : 'a layout -> 'b layout -> ('a, 'b) Polid.equal
Equality predicate.