Hacker News new | ask | show | jobs
by willtim 3276 days ago
Trees can be modelled with sum types, the mathematical dual of product types (records). Java doesn't have sum types and so inheritance has to be used to encode them.