3 ms·
Algebraic data types and ML-style modules are non-negotiable.
by catnaroek 9y ago
Algebraic data types and ML-style modules are non-negotiable.
- pjmlp 9y agoIn Ada, you can get similar concepts via tagged records and generic packages.
- catnaroek 9y agoTagged records are one possible in-memory representation of sum values, perhaps the most sensible one. But I don't want in-memory representations of sum values. I want sum values themselves. ML modules are much more than generic packages. ML's module system allows you to take an existing module, hide some of its components, make some of its concrete types abstract, and get a new module. My methodology of enforcing only one invariant in each module is impracticable without ML modules.