The example of the FOC system illustrates a common situation that calls for
hybrid mechanisms for code structuring that would more elegantly combine
the features of modules and classes.
This is an active research area, where several solutions are
currently explored. Let us mention in particular ``mixin'' modules
and objects with ``views''. The former
enrich the ML modules with inheritance and a late binding mechanism
[18, 4, 5]. The latter
provide a better object-encapsulation mechanism, in particular in the
presence of binary operations and ``friend'' functions; views also allow to
forget or rename methods more freely [68, 71].
Other object-oriented languages, such as CLOS, detach
methods from objects, transforming them into overloaded functions.
This approach is becoming
closer to traditional functional programming. Moreover, it
extends rather naturally to multi-methods [13, 22, 8] that allow to recover the symmetry
between the arguments of a same algebraic type. This approach is also more
expressive, since method dispatch may depend on
several arguments simultaneously rather than on a single one in a privileged
position. However, this complicates abstraction of object representation.
Indeed, overloading makes abstraction more difficult, since the
precise knowledge of the type of arguments is required to decide what
version of the method should be used.