Compositional data types
- ,
- Tom Hvitved
- University of Copenhagen
Research Output:
Conference Article in Proceeding or Book/Report chapter
Book chapter
Peer-reviewOpen access
Publication Information
Output type
Research Output:
Conference Article in Proceeding or Book/Report chapter
Book chapter
Peer-reviewOriginal language
Undefined/UnknownPages from-to (Number of pages)
Pages 83-94 (12 pages)Publication milestones
- Published - 01/09/2011
Publication status
Published - 01/09/2011
Place of publication
New York, NY, USAPublisher
Association for Computing Machinery, United StatesISBN (Print)
978-1-4503-0861-8Publication IDs
- Scopus: 80155129968
Host publication title
Proceedings of the seventh ACM SIGPLAN workshop on Generic programmingAbstract
Building on Wouter Swierstra's Data types à la carte, we present a comprehensive Haskell library of compositional data types suitable for practical applications. In this framework, data types and functions on them can be defined in a modular fashion. We extend the existing work by implementing a wide array of recursion schemes including monadic computations. Above all, we generalise recursive data types to contexts, which allow us to characterise a special yet frequent kind of catamorphisms. The thus established notion of term homomorphisms allows for flexible reuse and enables short-cut fusion style deforestation which yields considerable speedups. We demonstrate our framework in the setting of compiler construction, and moreover, we compare compositional data types with generic programming techniques and show that both are comparable in run-time performance and expressivity while our approach allows for stricter types. We substantiate this conclusion by lifting compositional data types to mutually recursive data types and generalised algebraic data types. Lastly, we compare the run-time performance of our techniques with traditional implementations over algebraic data types. The results are surprisingly good.
Publication metrics
PlumX, opens in new tab
Captures
53
Citations
34
