Module Gist.Product

Operating on products.


type 'p t = 'p product

The type for products.

val make : ?meta:'p Meta.t -> ?name:string -> ('p, 'p) fields -> 'p product

make fields is a product with:

  • fields the ordered sequence of fields of the product.
  • meta is the metadata (defaults to Meta.empty).
  • name the name of the product (defaults to ""). For records this is the type name. For variant cases this is the case name. For products, if non empty, this is the name of a type abbreviation.
val meta : 'p product -> 'p Meta.t

meta p is the metadata of p.

val name : 'p product -> string

name p is the name of p (if any).

val fields : 'p product -> ('p, 'p) fields

fields p are the fields of p.

val is_empty : 'p product -> bool

is_empty p is true if p has no fields.

val is_singleton : 'p product -> bool

is_singleton p is true if p has a single field.