Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
These are the types used for building records by folding over fields.
You should never have to think about them, and should be able to skip straight on to Record_builder
. They are exposed solely because they must be so that the application of Fields.make_creator
will type-check.
type ('field, 'head, 'tail, 'all_fields, 'extra) fold_step =
('head, 'all_fields, 'extra) accum ->
('all_fields -> 'field) * ('tail, 'all_fields, 'extra) accum
Each part of the fold has a type of this form.
type ('field, 'tail, 'all_fields, 'extra) handle_one_field =
('field,
('field, 'tail) Hlist.cons,
'tail,
'all_fields Hlist.nonempty,
'extra)
fold_step
A step of the fold over a single field has this type.
Each argument to Fields.make_creator
should take that field as an argument and return something of this type (see field
below).
type ('record, 'all_fields, 'extra) handle_all_fields =
('record,
'all_fields Hlist.nonempty,
Hlist.nil,
'all_fields Hlist.nonempty,
'extra)
fold_step
The overall fold of multiple steps created by applying Fields.make_creator
without an initial value should have a type of this form. You then supply it as an argument to build_for_record
below.