@garritfra It's called a tagged union (a structure with an integer tag and a union of the alternative types). The type system will not help you do the matching though, you'll have to do that manually switching on the tag and accessing the right member, or create jump tables (arrays of function pointers) indexed by the tag.