@MISC{Vouillon97usingmodules, author = {Jérôme Vouillon}, title = {Using Modules as Classes}, year = {1997} }
Bookmark
OpenURL
Abstract
We show how classes can be combined with a ML-like module system, so that the same constructions be used for both classes and modules. For that, we are brought to slightly extend the module system with implicit type quantification of module types. Introduction Classes and modules shares a lot of properties: they offer some form of abstraction; they structure the code and facilitate its reuse. Due to this overlapping of functionalities, it is sometimes difficult in a language providing both constructions to make a choice between them. This paper attempts to reduce the gap between these two styles of programming by merging classes and modules: we show how the classes of Objective ML [5] can be encoded as modules. This requires a small but natural extension to existing ML-like module systems: just as ML types are implicitly quantified, we propose that module types be also implicitly quantified over some type variables. We of course also make some specific additions to the module language...