logoalt Hacker News

masklinnlast Tuesday at 5:32 PM1 replyview on HN

> they can’t add them because of their bizarre insistence that every type has to have a designated zero value.

Nothing prevents adding union types with a zero value. Sure it sucks, but so do universal zero values in pretty much every other situation so that's not really a change.


Replies

umanwizardlast Tuesday at 6:39 PM

Making it so all sum types have to be nillable would make them dramatically worse (the basic motivating example for sum types is Option, the whole point of which is to get rid of NULL). I guess this is in agreement with your point.

show 3 replies