当前位置: X-MOL 学术arXiv.cs.LO › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
GADTs, Functoriality, Parametricity: Pick Two
arXiv - CS - Logic in Computer Science Pub Date : 2021-05-07 , DOI: arxiv-2105.03389
Patricia Johann, Enrico Ghiorzi, Daniel Jeffries

GADTs can be represented either as their Church encodings \`a la Atkey, or as fixpoints \`a la Johann and Polonsky. While a GADT represented as its Church encoding need not support a map function satisfying the functor laws, the fixpoint representation of a GADT must support such a map function even to be well-defined. The two representations of a GADT thus need not be the same in general. This observation forces a choice of representation of data types in languages supporting GADTs. In this paper we show that choosing whether to represent data types as their Church encodings or as fixpoints determines whether or not a language supporting GADTs can have parametric models. This choice thus has important consequences for how we can program with, and reason about, these advanced data types.

中文翻译:

GADT,功能性,参数性:选择两项

GADT可以表示为他们的教堂编码“ a Atkey”,也可以表示为定点“ a la Johann和Polonsky”。尽管以其教堂编码形式表示的GADT不需要支持满足函子定律的地图功能,但即使是明确定义的GADT的定点表示形式也必须支持这种地图功能。因此,GADT的两种表示形式通常不必相同。这种观察迫使选择使用支持GADT的语言来表示数据类型。在本文中,我们证明了选择是将数据类型表示为其Church编码还是作为固定点来确定支持GADT的语言是否可以具有参数模型。因此,这种选择对于我们如何使用这些高级数据类型进行编程并进行推理具有重要的意义。
更新日期:2021-05-10
down
wechat
bug