upvote
Strictly speaking the unions in TS are untagged/set-theoretic, which is different from Rust or Zig.
reply
Except often you want disjoined return arguments, while sum types setup an either-or situation. You can resort to tuples/arrays, but then that questions why the languages support multiple input arguments when tuples can be equally used for input. Frankly, any language that accepts multiple input arguments but only allows one return argument didn't have much thought put into it.
reply