| ▲ | sph 4 days ago | |||||||
Tagged enums != any type (i.e. runtime casting) Tagged enums are everywhere. I am writing a micro kernel in C and how I wish I had tagged enums instead of writing the same boilerplate of | ||||||||
| ▲ | flohofwoe 4 days ago | parent [-] | |||||||
> ...runtime casting... ...what else is a select on a tagged union than 'runtime casting' though. You have a single 'sum type' which you don't know what concrete type it actually is at runtime until you look at the tag and 'cast' to the concrete type associated with the tag. The fact that some languages have syntax sugar for the selection doesn't make the runtime overhead magically disappear. | ||||||||
| ||||||||