Generic views on data types
Stefan Holdermans, Johan T. Jeuring, Andres Löh, A. Rodriquez
Abstract
Open-access reader
Stefan Holdermans, Johan T. Jeuring, Andres Löh, A. Rodriquez
Abstract
Open-access reader
A generic function is defined by induction on the structure \nof types. The structure of a data type can be defined in several ways. For \nexample, in PolyP a pattern functor gives the structure of a data type \nviewed as a fixed point, and in Generic Haskell a structural representation \ntype gives an isomorphic type view of a data type in terms of sums \nof products. Depending on this generic view on the structure of data \ntypes, some generic functions are easier, more difficult, or even impossible \nto define. Furthermore, the efficiency of some generic functions can \nbe improved by choosing a different view. This paper introduces generic \nviews on data types and shows why they are useful. Furthermore, it \nshows how generic views have been added to Generic Haskell, an extension \nof the functional programming language Haskell that supports the \nconstruction of generic functions. The separation between inductive definitions \non type structure and generic views allows us to combine many \napproaches to generic programming in a single framework.
A significance statement is not available in the OpenAlex record.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
A generic function is defined by induction on the structure \nof types. The structure of a data type can be defined in several ways. For \nexample, in PolyP a pattern functor gives the structure of a data type \nviewed as a fixed point, and in Generic Haskell a structural representation \ntype gives an isomorphic type view of a data type in terms of sums \nof products. Depending on this generic view on the structure of data \ntypes, some generic functions are easier, more difficult, or even impossible \nto define. Furthermore, the efficiency of some generic functions can \nbe improved by choosing a different view. This paper introduces generic \nviews on data types and shows why they are useful. Furthermore, it \nshows how generic views have been added to Generic Haskell, an extension \nof the functional programming language Haskell that supports the \nconstruction of generic functions. The separation between inductive definitions \non type structure and generic views allows us to combine many \napproaches to generic programming in a single framework.
Key concepts: Haskell, Computer science, Generic programming, Functional programming, Data type, Data structure, Abstract data type, Type (biology)