Even though this might not seem very useful on the first sight this can make life simpler for generated code since no distinction needs to be done between enum, struct and maybe even union types. For struct and union types we could simply generate a unit struct as its tag type and return that for all instances.
Even though this might not seem very useful on the first sight this can make life simpler for generated code since no distinction needs to be done between
enum
,struct
and maybe evenunion
types. Forstruct
andunion
types we could simply generate a unit struct as itstag
type and return that for all instances.