Polytypic values possess polykinded types

A polytypic value is one that is defined by induction on the structure of types. In Haskell types are assigned so-called kinds that distinguish between manifest types like the type of integers and functions on types like the list type constructor. Previous approaches to polytypic programming were re...

Deskribapen osoa

Xehetasun bibliografikoak
Egile nagusia: Hinze, R
Formatua: Journal article
Argitaratua: 2015
_version_ 1826280398135492608
author Hinze, R
author_facet Hinze, R
author_sort Hinze, R
collection OXFORD
description A polytypic value is one that is defined by induction on the structure of types. In Haskell types are assigned so-called kinds that distinguish between manifest types like the type of integers and functions on types like the list type constructor. Previous approaches to polytypic programming were restricted in that they only allowed to parameterize values by types of one fixed kind. In this paper we show how to define values that are indexed by types of arbitrary kinds. It turns out that these polytypic values possess types that are indexed by kinds. We present several examples that demonstrate that the additional flexibility is useful in practice. One paradigmatic example is the mapping function, which describes the functorial action on arrows. A single polytypic definition yields mapping functions for data types of arbitrary kinds including first- and higher-order functors. Haskell's type system essentially corresponds to the simply typed lambda calculus with kinds playing the role of types. We show that the specialization of a polytypic value to concrete instances of data types can be phrased as an interpretation of the simply typed lambda calculus. This allows us to employ logical relations to prove properties of polytypic values. Among other things, we show that the polytypic mapping function satisfies suitable generalizations of the functorial laws.
first_indexed 2024-03-07T00:13:06Z
format Journal article
id oxford-uuid:79eb5ee7-bc26-4bc2-a50b-d6d2b0539142
institution University of Oxford
last_indexed 2024-03-07T00:13:06Z
publishDate 2015
record_format dspace
spelling oxford-uuid:79eb5ee7-bc26-4bc2-a50b-d6d2b05391422022-03-26T20:40:26ZPolytypic values possess polykinded typesJournal articlehttp://purl.org/coar/resource_type/c_dcae04bcuuid:79eb5ee7-bc26-4bc2-a50b-d6d2b0539142Department of Computer Science2015Hinze, RA polytypic value is one that is defined by induction on the structure of types. In Haskell types are assigned so-called kinds that distinguish between manifest types like the type of integers and functions on types like the list type constructor. Previous approaches to polytypic programming were restricted in that they only allowed to parameterize values by types of one fixed kind. In this paper we show how to define values that are indexed by types of arbitrary kinds. It turns out that these polytypic values possess types that are indexed by kinds. We present several examples that demonstrate that the additional flexibility is useful in practice. One paradigmatic example is the mapping function, which describes the functorial action on arrows. A single polytypic definition yields mapping functions for data types of arbitrary kinds including first- and higher-order functors. Haskell's type system essentially corresponds to the simply typed lambda calculus with kinds playing the role of types. We show that the specialization of a polytypic value to concrete instances of data types can be phrased as an interpretation of the simply typed lambda calculus. This allows us to employ logical relations to prove properties of polytypic values. Among other things, we show that the polytypic mapping function satisfies suitable generalizations of the functorial laws.
spellingShingle Hinze, R
Polytypic values possess polykinded types
title Polytypic values possess polykinded types
title_full Polytypic values possess polykinded types
title_fullStr Polytypic values possess polykinded types
title_full_unstemmed Polytypic values possess polykinded types
title_short Polytypic values possess polykinded types
title_sort polytypic values possess polykinded types
work_keys_str_mv AT hinzer polytypicvaluespossesspolykindedtypes