3 ms·
Structural Pattern Matching in Java
- orangecat 16y agoPerhaps I'm a bad software engineer, but I don't see anything terribly wrong with the instanceof solution. I'd certainly much rather read that 6 months later than "public abstract <T> T match(F<Empty, T> a, F<Leaf, T> b, F<Node, T> c)".