Maybe (at least in Haskell/Rust) is a sum type, not a union type, though.
EDIT: Ugh, sorry, those are the same, I was thinking of sum vs _product_ type, ignore me.
EDIT: Ugh, sorry, those are the same, I was thinking of sum vs _product_ type, ignore me.
Rust supports tagged unions, but can also optimize them to untagged in certain circumstances. We will probably add some kind of untagged union as well, mostly for FFI, but they're very unsafe, for the above reasons.