Is your feature request related to a problem? Please describe.
The following variant declaration
type abc = { #a; #b; #c };
has this runtime representation:
export type abc =
{ 'a' : null } |
{ 'b' : null } |
{ 'c' : null };
Here are patterns one could try to use for a function to check whether a value represents #a:
if(x.a) ... // wrong
if(x.a == null) ... // wrong
if(x.a === null) ... // right
There's no help that the TypeScript type checker can give to figure out the correct pattern.
Describe the solution you'd like
One possible idiomatic representation, at the cost of some reduced uniformity (variants with no arguments represented differently from variants with arguments):
export type abc = "a" | "b" | "c";
Is your feature request related to a problem? Please describe.
The following variant declaration
has this runtime representation:
Here are patterns one could try to use for a function to check whether a value represents
#a:There's no help that the TypeScript type checker can give to figure out the correct pattern.
Describe the solution you'd like
One possible idiomatic representation, at the cost of some reduced uniformity (variants with no arguments represented differently from variants with arguments):