3 ms·
In mathematical theory, the variant type is actually the theoretical opposite of a "struct" type. Mathematicians know this through the functions that apply to e
by crimsonalucard 7y ago
In mathematical theory, the variant type is actually the theoretical opposite of a "struct" type. Mathematicians know this through the functions that apply to each type.
Simply inverting the direction of functions that describe a "struct" type creates a structure that exactly describes a variant type.
The theory points to opposites but language writers, unaware of theory, more often than not leave out the critical primitive that should be intrinsic to all programming languages.