4 ms·
Would union types be manageable if you only use them with concrete types rather than generic or inferred ones, or is it too easy to accidentally refactor a None
by nyanpasu64 3y ago
Would union types be manageable if you only use them with concrete types rather than generic or inferred ones, or is it too easy to accidentally refactor a None into one of the cases (possibly hidden behind a typedef)?
- lmm 3y agoA feature you can't use with generic types is pretty useless, frankly. So "manageable" yes, but the cure is worse than the disease.
- nyanpasu64 3y agoI wouldn't say non-generic union types are useless; in fact the vast majority of sum or union types I write in application code (not libraries) are a combination of two or more concrete types, rather than generic ones.