Skip to main content
Erschienen in:
Buchtitelbild

Open Access 2021 | OriginalPaper | Buchkapitel

Parametricity for Primitive Nested Types

verfasst von : Patricia Johann, Enrico Ghiorzi, Daniel Jeffries

Erschienen in: Foundations of Software Science and Computation Structures

Verlag: Springer International Publishing

loading …

This paper considers parametricity and its resulting free theorems for nested data types. Rather than representing nested types via their Church encodings in a higher-kinded or dependently typed extension of System F, we adopt a functional programming perspective and design a Hindley-Milner-style calculus with primitives for constructing nested types directly as fixpoints. Our calculus can express all nested types appearing in the literature, including truly nested types. At the term level, it supports primitive pattern matching, map functions, and fold combinators for nested types. Our main contribution is the construction of a parametric model for our calculus. This is both delicate and challenging: to ensure the existence of semantic fixpoints interpreting nested types, and thus to establish a suitable Identity Extension Lemma for our calculus, our type system must explicitly track functoriality of types, and cocontinuity conditions on the functors interpreting them must be appropriately threaded throughout the model construction. We prove that our model satisfies an appropriate Abstraction Theorem and verifies all standard consequences of parametricity for primitive nested types.

download
DOWNLOAD
print
DRUCKEN
Metadaten
Titel
Parametricity for Primitive Nested Types
verfasst von
Patricia Johann
Enrico Ghiorzi
Daniel Jeffries
Copyright-Jahr
2021
DOI
https://doi.org/10.1007/978-3-030-71995-1_17

Premium Partner