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可以是他们的教会编码 à a la Atkey, 也可以是他们的教会编码 à la Johann 和 Polonsky。 GADT作为它的教会编码,虽然作为它的教会编码所代表的GADT不需要支持符合真菌法的地图函数,但GADT的固定点代表必须支持这样的地图函数,甚至需要明确界定。因此,GADT的两种表示方式一般不必是相同的。这种观察迫使人们选择支持GADT的语文中的数据类型的表示方式。在本文中,我们表明选择是将数据类型作为他们的教会编码,还是作为固定点来代表支持GADT的语文是否具有准数模型。因此,这一选择对于我们如何用这些先进的数据类型来编程及其理由有着重要的影响。