logoalt Hacker News

cyberaxyesterday at 11:25 PM1 replyview on HN

Some kind of an optional/variant type, enforced by the type system.


Replies

p1neconeyesterday at 11:40 PM

Or if even that feels too verbose, just a 'nullable' modifier on the variable or field definition, with the default being not nullable.

(Although Optional/Maybe types are definitely my preference based on the languages I've used)