3 ms·
The module system lets you define abstract types. The module system is the first defining characteristic of ML, the zeroth being type inference. Without the mod
by catnaroek 10y ago
The module system lets you define abstract types. The module system is the first defining characteristic of ML, the zeroth being type inference. Without the module system, ML simply isn't ML.
The importance of abstract types can't be overstated: they can enforce nontrivial invariants of data structures (e.g., that self-balancing search trees are actually balanced), by just reducing the scope in which they could possibly be broken, and without bringing in the machinery of dependent types.
- agumonkey 10y agoI don't disagree, but it doesn't contradict my point. ML module correlate functions. The basic feature that helped me are still there. I'd even say that without this I couldn't understand the value of Modules later on. Level zero functional programming enforce a strong thinking hygiene around parametricity. Modules and functors are just the next step.