|
|
|
|
|
by marcosdumay
3221 days 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. |
|