3 ms·
I would argue that this misses the use case of sum types, which typically don't have behaviour (or they'd just be interfaces!). For example, consider an AST fo
by atombender 7y ago
I would argue that this misses the use case of sum types, which typically don't have behaviour (or they'd just be interfaces!).
For example, consider an AST for a programming language. AST nodes don't have any behaviour (though they might have some methods for convenience, though nothing that implements behaviour). You want to do optimizations and printing and compilation and so on, but on top of the pure AST.