|
|
|
|
|
by catnaroek
3618 days ago
|
|
> You could say all Java reference types are sum types - either a real instance of that type or a null reference. That's not true. There are two fundamental differences: (0) Options can nest. Nullability doesn't nest. (1) Options are manipulated by pattern matching (or direct application of their induction principle, that is, Haskell's `maybe` function). In Java, you just assume a nullable variable isn't null, and if it is, well, you get an exception. |
|