Type-indexed data types
Autor: | Ralf Hinze, Johan Jeuring, Andres Löh |
---|---|
Přispěvatelé: | Softwaretechnologie, Dep Informatica |
Rok vydání: | 2004 |
Předmět: |
Parametric polymorphism
Recursive data type Computer science Programming language computer.software_genre Generic Haskell Data type Type family Polytypic programming Algebraic data type Wiskunde en Informatica (WIIN) Haskell Generalized algebraic data type Composite data type computer Wiskunde en Informatica Digital searching Software computer.programming_language |
Zdroj: | MPC |
ISSN: | 0167-6423 |
Popis: | A polytypic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of polytypic functions are the functions that can be derived in Haskell, such as show, read, and ‘==’. More advanced examples are functions for digital searching, pattern matching, unification, rewriting, and structure editing. For each of these problems, we not only have to define polytypic functionality, but also a type-indexed data type: a data type that is constructed in a generic way from an argument data type. For example, in the case of digital searching we have to define a search tree type by induction on the structure of the type of search keys. This paper shows how to define type-indexed data types, discusses several examples of type-indexed data types, and shows how to specialize type-indexed data types. The approach has been implemented in Generic Haskell, a generic programming extension of the functional language Haskell. |
Databáze: | OpenAIRE |
Externí odkaz: |