计算机科学 > 计算机科学中的逻辑
[提交于 2022年4月11日]
标题:GADTs, Functoriality, Parametricity: Pick Two
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:EPTCS[v1] 2022年4月11日 星期一 00:00:00 UTC