Engineering Higher-Order Modules in SML/NJ


SML/NJ and other Standard ML variants extend the ML module system with higher-order functors, elevating the module language to a full functional language. In this paper, we describe the implementation of the higher-order module system in SML/NJ, which is unique in providing “true” higher-order behavior at the static level. This second generation implementation of higher-order modules in SML/NJ is based on three key techniques: unique internal variables (entity variables) for naming static entities, a factorization of the static information in both basic modules and functors into signatures and realizations, and a static lambda calculus we call the entity calculus with static “effects” to represent the type-level mapping performed by a functor. This system implements MacQueen-Tofte’s re-elaboration semantics without having to re-elaborate functor bodies or appeal to fragile stamp properties.

DOI: 10.1007/978-3-642-16478-1_13

Extracted Key Phrases

3 Figures and Tables

Cite this paper

@inproceedings{Kuan2009EngineeringHM, title={Engineering Higher-Order Modules in SML/NJ}, author={George Kuan and David MacQueen}, booktitle={IFL}, year={2009} }