Module Variant.Case

Variant cases.

type name = Gist.name

The type for case constructor names. These must be unqualified. For example "Left" for Either.Left, or "`Left" for `Left.

type 'v t

The type for representing a variant case of a variant of type 'v.

val make : ?doc:string -> name -> 'v Product.t -> 'v t

make name p is a case with given constructor name and product.

  • raises Invalid_argument

    if name is "".

val name : 'v t -> name

name c is the constructor name of c.

val doc : 'v t -> string

doc c is the doc string of c.

val product : 'v t -> 'v Product.t

product c is the product of c.

val is_inline_record : 'v t -> bool

is_inline_record c is true if and only if c is a variant case with an inline record (checked by determining if the product's last field is named).