Affiliation:
1. University of Kansas, USA
2. University of Edinburgh, UK
Abstract
We present a novel typed language for extensible data types, generalizing and abstracting existing systems of row types and row polymorphism. Extensible data types are a powerful addition to traditional functional programming languages, capturing ideas from OOP-like record extension and polymorphism to modular compositional interpreters. We introduce row theories, a monoidal generalization of row types, giving a general account of record concatenation and projection (dually, variant injection and branching). We realize them via qualified types, abstracting the interpretation of records and variants over different row theories. Our approach naturally types terms untypable in other systems of extensible data types, while maintaining strong metatheoretic properties, such as coherence and principal types. Evidence for type qualifiers has computational content, determining the implementation of record and variant operations; we demonstrate this in giving a modular translation from our calculus, instantiated with various row theories, to polymorphic λ-calculus.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
13 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Abstracting Effect Systems for Algebraic Effect Handlers;Proceedings of the ACM on Programming Languages;2024-08-15
2. Soundly Handling Linearity;Proceedings of the ACM on Programming Languages;2024-01-05
3. The Hrewrite Library: A Term Rewriting Engine for Automatic Code Assembly;Lecture Notes in Computer Science;2024
4. Polymorphic Typestate for Session Types;International Symposium on Principles and Practice of Declarative Programming;2023-10-22
5. Structural Subtyping as Parametric Polymorphism;Proceedings of the ACM on Programming Languages;2023-10-16