Module Incr_dom_widgets__.Form.Description

Module to create a form blueprint by taking basic building blocks (like bool or string fields) and combining them into more complex structures which can be themselves combined with other structures.

type ('g, 's, 'ids) t

Describes how to edit a type as a series of form elements.

The two type parameters 's and 'g represent respectively the type that will be edited (set), and the type of the returned edited value (get), so they will be the same when a form is actually used.

The type parameter 'ids represents the different form elements used by the form for editing, and contains (in some tuple structure) all of the ids that should be used for those form elements.

val not_editable : default:'a ‑> ('a'a, unit) t
val bool : (bool, bool, bool Id.tt
val string : (string, string, string Id.tt
val sexp : of_sexp:(Core_kernel.Sexp.t ‑> 'a) ‑> sexp_of:('a ‑> Core_kernel.Sexp.t) ‑> ('a'a, string Id.tt
val variant : 'a list ‑> equal:('a ‑> 'a ‑> bool) ‑> ('a'a'a Variant_id.tt

Raises an exception if the provided list is empty or contains duplicate values.

val both : ('a's'a_idst ‑> ('b's'b_idst ‑> ('a * 'b's'a_ids * 'b_idst

Combine two t's.

val map : ('a's'idst ‑> f:('a ‑> 'b) ‑> ('b's'idst
val contra_map : ('g'b'idst ‑> f:('a ‑> 'b) ‑> ('g'a'idst
val conv : ('a's'idst ‑> f:('a ‑> 'ids ‑> block_id:Block.t Id.t ‑> ('bForm_error.t list) Core_kernel.Result.t) ‑> ('b'sBlock.t Id.t * 'idst

Perform a conversion which also validates the data, and so may have errors.

val conv_without_block : ('a's'idst ‑> f:('a ‑> 'ids ‑> ('bForm_error.t list) Core_kernel.Result.t) ‑> ('b's'idst
val list : ('g's'idst ‑> ('g list, 's list, 'ids list * 's List_id.tt
module Let_syntax : sig ... end
module Of_record : sig ... end

Build a form for a record directly, in the same manner as Record_builder or Profunctor.