arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.08759cs.PL
收藏

基于可扩展数据类型的泛型编程;或者,让特设可扩展数据类型不那么特设

Generic Programming with Extensible Data Types; Or, Making Ad Hoc Extensible Data Types Less Ad Hoc

Alex Hubers, J. Garrett Morris

AI总结:

该研究提出一种针对可扩展数据类型的泛型编程新方法,通过扩展行类型系统实现行层面的泛型编程,在System Rω中形式化并在Agda中给出其指称语义。

摘要:

我们提出了一种针对可扩展数据类型进行泛型编程的新方法。行类型(row types)可刻画记录与变体的结构,还可用于表达记录与变体的子类型化、记录扩展以及 case 分支的模块化组合。我们对行类型系统加以扩展,以实现针对行本身的泛型编程,涵盖的模式包括:将操作从组件类型提升至记录与变体,以及针对变体的 case 块与带标签函数的记录之间的对偶性,且不对记录和变体中包含的字段或构造子提出特定要求。我们在 System Rω(一种带行类型的 Fω 扩展系统)中对该方法进行了形式化,并在 Agda 中给出了(分层的)Rω 的指称语义。

英文摘要:

We present a novel approach to generic programming over extensible data types. Row types capture the structure of records and variants, and can be used to express record and variant subtyping, record extension, and modular composition of case branches. We extend row typing to capture generic programming over rows themselves, capturing patterns including lifting operations to records and variations from their component types, and the duality between cases blocks over variants and records of labeled functions, without placing specific requirements on the fields or constructors present in the records and variants. We formalize our approach in System Rω, an extension of Fω with row types, and give a denotational semantics for (stratified) Rω in Agda.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑