by hurril · 3y ago · 0 comments
Better names would be "tagged union" (which is spot-on descriptive - because it *is* a union with a tag slapped on - but "tagged_union" of course is a bit unwieldy as keyword) or "variant" (which is the name for that thing in C++ and elsewhere since forever - it's not like Rust invented those tagged-union-thingies, it just added some convenient syntax sugar to the language to deal with them).
` (* enum ) type 'a Option = Some of 'a | None `
(
struct - well: record. *) type Company = { Name : string Age : int }Fudge. No idea how to format that in HN.