4 ms·
Thinking about it, it's not obviously worth making sum types non-nillable unless you also figure out a comprehensive nil-free solution for the rest of the langu
by ajb 2y ago
Thinking about it, it's not obviously worth making sum types non-nillable unless you also figure out a comprehensive nil-free solution for the rest of the language. Because if you include any interface in your sum, that branch will be nillable anyway. So you might as well check for nil only once at the base case, rather than on each branch.