There's also no compiletime guarantee that Nothing is handled in Haskell; there are plenty of unsafe partial functions. In a non-total language, you unfortunately have to avoid partial functions without help from the compiler.
You're quite right that programming with these kinds of types in Java introduces you to a whole new kind of Hell! I'm not sure I'd recommend it.
However, I'm simply pointing out that types like these are _not_ language features. Some languages may be better suited to them than others, but they are definitely library features, and had best not be considered otherwise.
You're quite right that programming with these kinds of types in Java introduces you to a whole new kind of Hell! I'm not sure I'd recommend it.
However, I'm simply pointing out that types like these are _not_ language features. Some languages may be better suited to them than others, but they are definitely library features, and had best not be considered otherwise.