3 ms·
They enumerate a finite set of disjoint cases, so in some sense they are an enumeration. But the real reason is, of course, that sum types can be seen a general
by hope-striker 7y ago
They enumerate a finite set of disjoint cases, so in some sense they are an enumeration. But the real reason is, of course, that sum types can be seen a generalization of C enums, so the syntax was chosen to maximize familiarity.
- gowld 7y agoCases aren't values, though. a,b,c is an enum type over enumerable data. int, char, float is an enum kind of enumerable types.