Flexible and Reversible Conversion between Extensible Records and Overloading Constraints for ML
Alvise Span\`o

TL;DR
This paper introduces a reversible, type-driven transformation between extensible records and overloading constraints in ML-like languages, enabling flexible switching for better code reuse and interoperability.
Contribution
It proposes novel 'inject' and 'eject' language constructs for reversible conversion between records and constraints, enhancing language flexibility.
Findings
Reversible conversion between records and constraints demonstrated
Language constructs enable flexible switching with minimal overhead
Improves interoperability between different programming styles
Abstract
Most ML-like functional languages provide records and overloading as unrelated features. Records not only represent data structures, but are also used to implement dictionary passing, whereas overloading produces type constraints that are basically dictionaries subject to compiler-driven dispatching. In this paper we explore how records and overloading constraints can be converted one into the other, allowing the programmer to switch between the two at a very reasonable cost in terms of syntactic overhead. To achieve this we introduce two language constructs, namely inject and eject, performing a type-driven syntactic transformation. The former literally injects constraints into the type and produces a function adding an extra record argument. The latter does the opposite, ejecting a record argument from a function and turning fields into type constraints. The conversion is reversible…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDistributed and Parallel Computing Systems
