6 ms·
C# has sum types
by throwaway858 4y ago
C# has sum types
- masklinn 4y agoC# does not have sum types. It has "enumeration types" but their behaviour is exactly that of C's, with various additional conveniences but critically (and unlike Java for instance) no more type-safety.
- alkonaut 4y agoNot without squinting really hard and making some OO monstrosity with internal impls of an outer abstract type it doesn’t. And that’s not really language support it’s banging your rocks together really hard trying to bend it into being ML.