Gist.Variant
Operating on variants.
type 'v case = 'v product
The type for representing variant cases of a variant of type 'v
.
module Case : sig ... end
Variant cases.
type 'a gist := 'a t
type 'v t = 'v variant
The type for representing variants of type 'v
.
v name project cases
is a variant named name
with deconstructor project
and case enumeration cases
.
val name : 'v variant -> string
name v
is the name of v
.
The sum
type has specializations for these variants. You should like use that if appropriate in your descriptions, see sums. Consumers of the representation can always generalize with Sum.to_variant
which invokes these functions.
of_option
represents options of the given representation type as a variant.
val of_either :
?meta:('a, 'b) Stdlib.Either.t Meta.t ->
'a gist ->
'b gist ->
('a, 'b) Stdlib.Either.t variant
of_option
represents eithers of the given representation type as a variant.