Mixing modules and objects Chapter 5 Mixing modules and objects Modules and classes play different roles. On the one hand, modules can be embedded, and parameterized by types and values.
Modules also allow value and type abstraction on a large scale.
At first, there seems to be little redundancy. Indeed, to benefit from both features simultaneously, modules and classes are often combined together. However, both modules and classes provide means of structuring the code. In this chapter, we discusses the overlapping of features and the specificities, and show how to use them in harmony. Overlapping Many abstract datatypes can be defined using either classes or modules.