package records

  1. Overview
  2. Docs

Module Record.UnsafeSource

Unsafe interface

The Unsafe.declare function returns a 's layout, which is only safe when 's is only instanciated once in this context.

Sourceval declare : string -> 's layout

Create a new layout with the given name.

Sourceval field : 's layout -> string -> 'a Type.t -> ('a, 's) Field.t

Add a field to a layout. This modifies the layout and returns the field.

Sourceval seal : 's layout -> unit

Make the layout unmodifiable. It is necessary before constructing values.

Sourceval make : 's layout -> 's t

Allocate a record of a given layout, with all fields initially unset.

Sourceval layout_name : 's layout -> string

Get the name that was given to a layout.

Sourceval layout_id : 's layout -> 's Polid.t

Get the unique identifier given to a layout.