Comment

Comment by megawatthours

You can do this in Java using derive4j: https://github.com/derive4j/derive4j.

It generates code for algebraic data types which offer a typesafe interface similar to the `case` statements in languages that natively support pattern matching.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton