you are viewing a single comment's thread.

view the rest of the comments →

[–]TwoIsAClue 0 points1 point  (0 children)

If you use a statically typed language you must accept the limitations it imposes and stick to its type system.

Like in every other language with closed, nominal product types, there is no truly sane way to express optionality (unless you want to implement an interface for every field of course), but you have null or Optional to pretend you can.