Re:The Next Step for Generics
by dragonwriter on Wednesday June 17, 2020 @01:56PM
(#23554491)
> I spent 2 days implementing a (terrible) discriminated union struct type in C#
A type system without native or at least low-impedance support for discriminated unions is, well, not a very good type system.
> Type systems need to be more expressive if we’re going to be able to increase developer productivity without costing program safety.
Lots of type systems support discriminated unions directly, or at least make it trivial to implement them. C# perhaps doesn’t, but that's a problem with C#, not typed programming in general.
A type system without native or at least low-impedance support for discriminated unions is, well, not a very good type system.
> Type systems need to be more expressive if we’re going to be able to increase developer productivity without costing program safety.
Lots of type systems support discriminated unions directly, or at least make it trivial to implement them. C# perhaps doesn’t, but that's a problem with C#, not typed programming in general.