Extensible Recursive Functions, Algebraically

📅 2024-10-15
đŸ›ī¸ arXiv.org
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the challenge of modularly composing recursive functions over extensible data types. We propose a novel formal framework based on bounded algebras and Mendler-style recursion. Central to our approach is the row-typed RΉÎŧ type system, which uniformly models both recursive types and terms, enabling dynamic, type-safe composition of types and functions while automatically adapting recursive calls to newly added variants. We mechanize the metatheory in Agda, formally verifying type safety and expressive completeness. To our knowledge, this is the first formal treatment that achieves compositional, type-safe definition of recursive functions over extensible types. Our framework provides a rigorous algebraic semantic foundation and practical construction principles for modular language design.

Technology Category

Application Category

📝 Abstract
We explore recursive programming with extensible data types. Row types make the structure of data types first class, and can express a variety of type system features from subtyping to modular combination of case branches. Our goal is the modular combination of recursive types and of recursive functions over them. The most significant challenge is in recursive function calls, which may need to account for new cases in a combined type. We introduce bounded algebras, Mendler-style descriptions of recursive functions in which recursive calls can happen at larger types, and show that they provide expressive recursion over extensible data types. We formalize our approach in R$omegamu$, a small extension of an existing row type theory with support for recursive terms and types, and mechanize the metatheory of R$omegamu$ via an embedding in Agda
Problem

Research questions and friction points this paper is trying to address.

Modular combination of recursive types and functions
Handling recursive calls with extensible data types
Expressive recursion over extensible data types
Innovation

Methods, ideas, or system contributions that make the work stand out.

Extensible histomorphisms for recursive functions
Mendler-style descriptions for flexible recursion
RΉÎŧ theory formalizes extensible recursive types
🔎 Similar Papers
No similar papers found.
A
Alexander Hubers
Department of Computer Science, The University of Iowa, 14 MacLean Hall, Iowa City, Iowa, USA
Apoorv Ingle
Apoorv Ingle
University of Iowa
Programming languagesType systemsLogic
Andrew Marmaduke
Andrew Marmaduke
The University of Iowa
J
J. G. Morris
Department of Computer Science, The University of Iowa, 14 MacLean Hall, Iowa City, Iowa, USA