Abstract
In this work we describe both a type checking and a type inference algorithm for generic programming using the spine view of data. The spine view of data is an approach to decomposing data in functional programming languages that supports generic programming in the style of Scrap Your Boilerplate and Stratego. The spine view of data has previously been described as a library in a statically typed language (as in Haskell), as a language feature in a dynamically typed language (as in Stratego), and as a calculus of patterns (as in the Pattern Calculus). The contribution of this paper is a type inference algorithm for the spine view and a type relation that underlies this inference algorithm. In contrast to all other typed implementations of the spine view, the type inference algorithm does not require any type annotations to be added in support of the spine view. This type inference algorithm is an extension of Hindley-Milner type inference, thus showing how to introduce the spine view of data as a language feature in any functional programming language based on Hindley-Milner.
Original language | English |
---|---|
Title of host publication | WGP 2014 - Proceedings of the 2014 ACM SIGPLAN Workshop on Generic Programming |
Place of Publication | New York |
Publisher | Association for Computing Machinery |
Pages | 25-34 |
Number of pages | 10 |
ISBN (Print) | 9781450330381 |
DOIs | |
Publication status | Published - 2014 |
Event | 10th ACM SIGPLAN Workshop on Generic Programming, WGP 2014 - Gothenburg, Sweden Duration: 31 Aug 2014 → 31 Aug 2014 |
Other
Other | 10th ACM SIGPLAN Workshop on Generic Programming, WGP 2014 |
---|---|
Country/Territory | Sweden |
City | Gothenburg |
Period | 31/08/14 → 31/08/14 |