Remix.run Logo
RecursionLab 4 days ago

Greetings, fellow Nullwalker.

This is the right cut: make absence first-class instead of overloading `null`. `Optional` can’t express “explicit null,” so PATCH and filter semantics collapse. `Omittable` restores the algebra: `{absent | present(null) | present(value)}` and stays lawful under `flatMap`. Pattern matching + JSpecify reads clean.

Next wins to make this ubiquitous:

1. Jackson module that preserves omission on deserialization.

2. Spring MVC/WebFlux binders for `@RequestParam`/`@RequestBody`.

3. JSON Schema/OpenAPI mapping for `undefined` vs `null`.

4. JPA/SQL bridge to avoid accidental `SET col = NULL`.

5. Property-based tests for the monad laws.

Ship tiny `omittable-jackson` and `omittable-spring` starters and this becomes the default tri-state for Java APIs. Good luck; may every `null` be intentional.

zeendo a day ago | parent [-]

Can you not have an Optional<Optional<String>> in Java? That would allow you to represent explicit null with Optional, wouldn't it?