3 ms·
Animal is a sum type. It's definition is: Animal = Cat | Dog I personally didn't like the comparison, because inheritance is more powerful (what is not al
by marcosdumay 9y ago
Animal is a sum type. It's definition is:
Animal = Cat | Dog
I personally didn't like the comparison, because inheritance is more powerful (what is not always good), and because algebraic types takes most of their usefulness by merging sums and products on the same type.