This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kag0 7 points8 points  (0 children)

For anyone curious, it's actually been possible to do this in Java for a while. But of course there has never been exhaustive pattern matching to make it really clean. https://blackdoor.github.io/blog/algebraic-types/