OO Programming styles in ML

Bernard Berthomieu

LAAS Report #2000111, March 2000 (148p).


This report discusses encoding of objects and OOP idioms into ML, or more generally into programming languages equipped with parametric polymorphism, recursive type operators, and abstract types. It is shown that the essential OO concepts and idioms, including inheritance and dynamic dispatch, can be encoded in this well understood framework, without requiring any operational or typing extensions of ML, that is in much simpler operational and typing frameworks than previously proposed. These encodings are unusual in essentially two aspects: They do not rely on records, neither simple nor extensible, but upon tuples instead, and they do not rely on subtyping and subsumption, but on an encoding of inheritance polymorphism into parametric polymorphism. Classes are encoded as abstract types through SML's structures. The encodings can readily be used for OO programming in ML, or can serve as reference interpretations of object features in dialects of ML extended with OO features


Home Page