News for hackers. Stuff that matters.
Re:Explore union types in C# 15 by dgb23 on Thursday April 09, 2026 @05:03AM (#47701027)
I think Zig does a very good illustration of this distinction. They separate:

- enum: essentially just a typed uint tag collection

- union: the plain data structure that can contain any of several types

- tagged union: combines enums and unions, so you can dispatch on its tag to get one of the union types

Read from this section and they appear in order:

https://ziglang.org/documentation/master/#enum

There are no comments on this comment yet.