Module Variant.Case

Variant cases.

Variant cases are products whose name is the case name.

Variant cases

type 'v t = 'v case

The type for products.

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

make fields is a product with fields fields. name is optional, it defaults to "".

val meta : 'v case -> 'v Meta.t

meta c is the metadata of c.

val name : 'v case -> string

name c is the case name of c (if any).

val fields : 'v case -> ('v, 'v) fields

fields c are the fields of c.

val is_empty : 'v case -> bool

is_empty c is true if the case has no arguments.

val rec_field_count : 'v case -> int

rec_field_count c is the number of recursive fields in c.