3 ms·
I'm surprised how many modern languages lack first-class sum type support, considering the amount of domain use cases for them.
by ivanjermakov 1y ago
I'm surprised how many modern languages lack first-class sum type support, considering the amount of domain use cases for them.
- js8 1y agoNot only programming languages, SQL as well. Sum types are also kinda awkward to represent in relational algebra (it can be done similar to inheritance, your type constructor will be the ancestor relation and for each data constructor you have a descendant relation - this is because of the categorical duality between sum and product types, foreign key constraints are arrows).