Modular typechecking for hierarchically extensible datatypes and functions
T Millstein, C Bleckner, C Chambers - ACM Transactions on …, 2004 - dl.acm.org
T Millstein, C Bleckner, C Chambers
ACM Transactions on Programming Languages and Systems (TOPLAS), 2004•dl.acm.orgOne promising approach for adding object-oriented (OO) facilities to functional languages
like ML is to generalize the existing datatype and function constructs to be hierarchical and
extensible, so that datatype variants simulate classes and function cases simulate methods.
This approach allows existing datatypes to be easily extended with both new operations and
new variants, resolving a longstanding conflict between the functional and OO styles.
However, previous designs based on this approach have been forced to give up modular …
like ML is to generalize the existing datatype and function constructs to be hierarchical and
extensible, so that datatype variants simulate classes and function cases simulate methods.
This approach allows existing datatypes to be easily extended with both new operations and
new variants, resolving a longstanding conflict between the functional and OO styles.
However, previous designs based on this approach have been forced to give up modular …
One promising approach for adding object-oriented (OO) facilities to functional languages like ML is to generalize the existing datatype and function constructs to be hierarchical and extensible, so that datatype variants simulate classes and function cases simulate methods. This approach allows existing datatypes to be easily extended with both new operations and new variants, resolving a longstanding conflict between the functional and OO styles. However, previous designs based on this approach have been forced to give up modular typechecking, requiring whole-program checks to ensure type safety. We describe Extensible ML (EML), an ML-like language that supports hierarchical, extensible datatypes and functions while preserving purely modular typechecking. To achieve this result,EML's type system imposes a few requirements on datatype and function extensibility, but EML is still able to express both traditional functional and OO idioms. We have formalized a core version of EML and proven the associated type system sound, and we have developed a prototype interpreter for the language.
ACM Digital Library