A simple semantics for ML polymorphism
FPCA '89 Proceedings of the fourth international conference on Functional programming languages and computer architecture
PLDI '91 Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation
Type inference for record concatenation and multiple inheritance
Information and Computation
Compiling with continuations
A compilation method for ML-style polymorphic record calculi
POPL '92 Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The essence of compiling with continuations
PLDI '93 Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation
Theoretical aspects of object-oriented programming
A polymorphic record calculus and its compilation
ACM Transactions on Programming Languages and Systems (TOPLAS)
Simple objects for Standard ML
PLDI '96 Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation
Pizza into Java: translating theory into practice
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Type checking higher-order polymorphic multi-methods
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Objective ML: an effective object-oriented extension to ML
Theory and Practice of Object Systems - Third workshop on foundations of object-oriented languages (FOOL 3)
Modular object-oriented programming with units and mixins
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
Revised5 report on the algorithmic language scheme
ACM SIGPLAN Notices
Extensible algebraic datatypes with defaults
Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
The Definition of Standard ML
Modular typechecking for hierarchically extensible datatypes and functions
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
Synthesizing Object-Oriented and Functional Design to Promote Re-Use
ECCOP '98 Proceedings of the 12th European Conference on Object-Oriented Programming
Programming languages for reusable software components
Programming languages for reusable software components
Exception Handlers as Extensible Cases
APLAS '08 Proceedings of the 6th Asian Symposium on Programming Languages and Systems
Language support for feature-oriented product line engineering
FOSD '09 Proceedings of the First International Workshop on Feature-Oriented Software Development
Ur: statically-typed metaprogramming with type-level record computation
PLDI '10 Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation
Row-based effect types for database integration
TLDI '12 Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation
Proceedings of the 8th symposium on Dynamic languages
Hi-index | 0.00 |
We present language mechanisms for polymorphic, extensible records and their exact dual, polymorphic sums with extensible first-class cases. These features make it possible to easily extend existing code with new cases. In fact, such extensions do not require any changes to code that adheres to a particular programming style. Using that style, individual extensions can be written independently and later be composed to form larger components. These language mechanisms provide a solution to the expression problem.We study the proposed mechanisms in the context of an implicitly typed, purely functional language PolyR. We give a type system for the language and provide rules for a 2-phase transformation: first into an explicitly typed λ-calculus with record polymorphism, and finally to efficient index-passing code. The first phase eliminates sums and cases by taking advantage of the duality with records.We implement a version of PolyR extended with imperative features and pattern matching - we call this language MLPolyR. Programs in MLPolyR require no type annotations - the implementation employs a reconstruction algorithm to infer all types. The compiler generates machine code (currently for PowerPC) and optimizes the representation of sums by eliminating closures generated by the dual construction.