3 ms·
Union types are pretty ugly. Eg they can't distinguish between one or two layers of nullable. Or between null and an optional null. (In eg Rust syntax betwee
by eru 3y ago
Union types are pretty ugly.
Eg they can't distinguish between one or two layers of nullable. Or between null and an optional null.
(In eg Rust syntax between `Option<Option<MyType>>` vs `Option<MyType>`. Or `()` vs `Option<()>`, where `()` would be how you spell `null` in Rust.)
Using tags is simpler and cleaner.