3 ms·
Bottom should rather be the empty type and one consequence of that is that is you happen to build a x of type bottom then x sort of belongs to every type
by afiori 7y ago
Bottom should rather be the empty type and one consequence of that is that is you happen to build a x of type bottom then x sort of belongs to every type
- Ao7bei3s 7y agoThat's the formal definition, and an interesting corollary with interesting consequences (from a typing perspective, a function of any return type can always opt to halt instead of returning. note that in a lazily evaluated language like Haskell the caller can still continue, as long as it does not evaluate the result). But I didn't go with that because it doesn't answer the question (is null the bottom type? no.), and in the context of return types (the main use case, though not the only) it's equivalent to what I said (no possible return value -> cannot return).