The university library will be closed from December 20, 2025 to January 11, 2026. From January 12, 2026, regular opening hours will apply again. Exception: The main medical library and the central library will be open again from January 5, 2026. Further information

Result: Arity-generic datatype-generic programming

Title:
Arity-generic datatype-generic programming
Contributors:
The Pennsylvania State University CiteSeerX Archives
Publication Year:
2010
Collection:
CiteSeerX
Document Type:
Academic journal text
File Description:
application/pdf
Language:
English
Rights:
Metadata may be used without restrictions as long as the oai identifier remains attached to it.
Accession Number:
edsbas.641CF5B2
Database:
BASE

Further information

Some programs are doubly-generic. For example, map is datatype-generic in that many different data structures support a mapping operation. A generic programming language like Generic Haskell can use a single definition to generate map for each type. However, map is also arity-generic because it belongs to a family of related operations that differ in the number of arguments. For lists, this family includes repeat, map, zipWith, zipWith3, zipWith4, etc. With dependent types or clever programming, one can unify all of these functions together in a single definition. However, no one has explored the combination of these two forms of genericity. These two axes are not orthogonal because the idea of arity appears in Generic Haskell: datatype-generic versions of repeat, map and zipWith have different arities of kind-indexed types. In this paper, we define arity-generic datatype-generic pro-grams by building a framework for Generic Haskell-style generic programming in the dependently-typed programming language