Engineering higher-order modules in SML/NJ

  • Authors:
  • George Kuan;David MacQueen

  • Affiliations:
  • University of Chicago;University of Chicago

  • Venue:
  • IFL'09 Proceedings of the 21st international conference on Implementation and application of functional languages
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 higher-order modules in SML/NJ, which is unique in providing "true" higher-order static behavior. This implementation is based on three key ideas: unique internal variables (entity variables) for naming static entities, factorization of the static information in both basic modules and functors into signatures and realizations, and representing the static "effects" and type-level mapping performed by a functor using a static lambda calculus (the entity calculus). This design conforms to MacQueen-Tofte's re-elaboration semantics without having to re-elaborate functor bodies at functor applications.