Often I’ll be defining a record type like:
type adt = A of int | B of string
type t = {
adt: adt;
uid: int;
}
where I have to define some entire separate type to hold the variant. The type is never constructed by itself and it would be more convenient to just be able to write:
type t = {
adt: A of int | B of string
uid: int;
}
Has this sort of anonymous variant structure ever been proposed for OCaml?