Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1411286.1411301acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Comparing libraries for generic programming in haskell

Published: 25 September 2008 Publication History
  • Get Citation Alerts
  • Abstract

    Datatype-generic programming is defining functions that depend on the structure, or "shape", of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are morethan 10 proposals for generic programming libraries orlanguage extensions for Haskell. To compare and characterise the many generic programming libraries in atyped functional language, we introduce a set of criteria and develop a generic programming benchmark: a set of characteristic examples testing various facets of datatype-generic programming. We have implemented the benchmark for nine existing Haskell generic programming libraries and present the evaluation of the libraries. The comparison is useful for reaching a common standard for generic programming, but also for a programmer who has to choose a particular approach for datatype-generic programming.

    Supplementary Material

    JPG File (1411301.jpg)
    index.html (index.html)
    Slides from the presentation
    Audio only (1411301.mp3)
    Video (1411301.mp4)

    References

    [1]
    F. Atanassow and J. Jeuring. Inferring type isomorphisms generically. In MPC'04, LNCS 3125, pages 32--53, 2004.
    [2]
    J.-P. Bernardy, P. Jansson, M. Zalewski, S. Schupp, and A. Priesnitz. A comparison of C++ concepts and Haskell type classes. In ACM SIGPLAN Workshop on Generic Programming, 2008.
    [3]
    R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, editor, MPC'98, LNCS 1422, pages 52--67, 1998.
    [4]
    B. Bringert and A. Ranta. A pattern for almost compositional functions. In ICFP'06, pages 216--226, 2006.
    [5]
    J. Cheney and R. Hinze. A lightweight implementation of generics and dynamics. In Haskell'02, pages 90--104, 2002.
    [6]
    K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP'00, pages 286--279, 2000.
    [7]
    D. Clarke and A. Löh. Generic haskell, specifically. In Proceedings of the IFIP TC2/WG2.1 Working Conference on Generic Programming, pages 21--47. Kluwer, B.V., 2003.
    [8]
    J. Derrick and S. Thompson. FORSE: Formally-Based Tool Support for Erlang Development. Project description, 2005. URL http://www.cs.kent.ac.uk/projects/forse/.
    [9]
    R. Garcia, J. Järvi, A. Lumsdaine, J. Siek, and J. Willcock. An extended comparative study of language support for generic programming. J. Funct. Program., 17(2):145--205, 2007.
    [10]
    Haskell Generic Library list. Generic programming criteria template, 2008. Wiki page at haskell.org/haskellwiki/Applications_and_libraries/Generic_programming.
    [11]
    T. Haskell Prime list. Haskell prime, 2006. Wiki page at http://hackage.haskell.org/trac/haskell-prime.
    [12]
    R. Hinze. Generics for the masses. Journal of Functional Programming, 16:451--482, 2006.
    [13]
    R. Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43(2-3):129--159, 2002.
    [14]
    R. Hinze and A. Löh. "Scrap Your Boilerplate" revolutions. In MPC'06, LNCS 4014, pages 180--208, 2006.
    [15]
    R. Hinze, A. Löh, and B. C. d. S. Oliveira. "Scrap Your Boilerplate" reloaded. In P. Wadler and M. Hagiya, editors, FLOPS'06, LNCS 3945, 2006.
    [16]
    R. Hinze, J. Jeuring, and A. Löh. Comparing approches to generic programming in haskell. In Datatype-Generic Programming, LNCS 4719, pages 72--149. 2007.
    [17]
    S. Holdermans, J. Jeuring, A. Löh, and A. Rodriguez. Generic views on data types. In T. Uustalu, editor, MPC'06, volume 4014 of LNCS, pages 209--234, 2006.
    [18]
    P. Hudak, J. Hughes, S. Peyton Jones, and P. Wadler. A history of Haskell: being lazy with class. In HOPL III, pages 12-1--12-55, 2007.
    [19]
    P. Jansson and J. Jeuring. PolyP - a polytypic programming language extension. In POPL'97, pages 470--482, 1997.
    [20]
    P. Jansson and J. Jeuring. Polytypic data conversion programs. Science of Computer Programming, 43(1):35--75, 2002.
    [21]
    P. Jansson and J. Jeuring. PolyLib - a polytypic function library. Workshop on Generic Programming, Marstrand, 1998.
    [22]
    O. Kiselyov. Smash your boilerplate without class and typeable. http://article.gmane.org/gmane.comp.lang.haskell.general/14086, 2006.
    [23]
    P. Koopman, A. Alimarine, J. Tretmans, and R. Plasmeijer. Gast: Generic automated software testing. In R. Peña and T. Arts, editors, IFL'02, volume 2670 of LNCS, 2003.
    [24]
    R. Lämmel and S. Peyton Jones. Scrap your boilerplate: a practical approach to generic programming. In TLDI, pages 26--37, 2003.
    [25]
    R. Lämmel and S. Peyton Jones. Scrap more boilerplate: reflection, zips, and generalised casts. In ICFP, pages 244--255, 2004.
    [26]
    R. Lämmel and S. Peyton Jones. Scrap your boilerplate with class: extensible generic functions. In ICFP, pages 204--215, 2005.
    [27]
    R. Lämmel and J. Visser. A Strafunski Application Letter. In PADL'03, LNCS 2562, pages 357--375, 2003.
    [28]
    R. Lämmel and J. Visser. Typed combinators for generic traversal. In PADL'02, LNCS 2257, pages 137--154, 2002.
    [29]
    H. Li, C. Reinke, and S. Thompson. Tool support for refactoring functional programs. In Haskell'03, pages 27--38, 2003.
    [30]
    A. Löh, D. Clarke, and J. Jeuring. Depency-style Generic Haskell. In ICFP'03, pages 141--152, 2003.
    [31]
    I. Lynagh. Template Haskell: A report from the field. http://www.comlab.ox.ac.uk/oucl/work/ian.lynagh/papers/, 2003.
    [32]
    L. Meertens. Calculate polytypically! In H. Kuchen and S. D. Swierstra, editors, PLILP, LNCS 1140, pages 1--16, 1996.
    [33]
    N. Mitchell and C. Runciman. A static checker for safe pattern matching in Haskell. In Trends in Functional Programming, volume 6. Intellect, 2007a.
    [34]
    N. Mitchell and C. Runciman. Uniform boilerplate and list processing. In Haskell'07, 2007b.
    [35]
    M. Naylor and C. Runciman. Finding inputs that reach a target expression. In SCAM'07, pages 133--142, 2007.
    [36]
    U. Norell and P. Jansson. Polytypic programming in Haskell. In IFL'03, LNCS 3145, pages 168--184, 2004.

    Cited By

    View all

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    Haskell '08: Proceedings of the first ACM SIGPLAN symposium on Haskell
    September 2008
    134 pages
    ISBN:9781605580647
    DOI:10.1145/1411286
    • Program Chair:
    • Andy Gill
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 44, Issue 2
      HASKELL '08
      February 2009
      126 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1543134
      Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 25 September 2008

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. datatype-generic programming
    2. libraries comparison

    Qualifiers

    • Research-article

    Conference

    ICFP08
    Sponsor:

    Acceptance Rates

    Haskell '08 Paper Acceptance Rate 13 of 28 submissions, 46%;
    Overall Acceptance Rate 57 of 143 submissions, 40%

    Upcoming Conference

    ICFP '24

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)16
    • Downloads (Last 6 weeks)3
    Reflects downloads up to 09 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)Could Tierless Languages Reduce IoT Development Grief?ACM Transactions on Internet of Things10.1145/35729014:1(1-35)Online publication date: 23-Feb-2023
    • (2020)Staged sums of productsProceedings of the 13th ACM SIGPLAN International Symposium on Haskell10.1145/3406088.3409021(122-135)Online publication date: 27-Aug-2020
    • (2018)Generic programming of all kindsACM SIGPLAN Notices10.1145/3299711.324274553:7(41-54)Online publication date: 17-Sep-2018
    • (2018)Generic programming of all kindsProceedings of the 11th ACM SIGPLAN International Symposium on Haskell10.1145/3242744.3242745(41-54)Online publication date: 17-Sep-2018
    • (2018)Sums of products for mutually recursive datatypes: the appropriationist’s view on generic programmingProceedings of the 3rd ACM SIGPLAN International Workshop on Type-Driven Development10.1145/3240719.3241786(65-77)Online publication date: 27-Sep-2018
    • (2018)Type generic observation of intermediate data structures for debugging lazy functional programsComputer Languages, Systems & Structures10.1016/j.cl.2017.05.00152(92-110)Online publication date: Jun-2018
    • (2017)A chrestomathy of DSL implementationsProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136038(103-114)Online publication date: 23-Oct-2017
    • (2015)Type-level web APIs with Servant: an exercise in domain-specific generic programmingProceedings of the 11th ACM SIGPLAN Workshop on Generic Programming10.1145/2808098.2808099(1-12)Online publication date: 30-Aug-2015
    • (2014)The Kansas University rewrite engineJournal of Functional Programming10.1017/S095679681400018524:4(434-473)Online publication date: 3-Jul-2014
    • (2014)Type Generic ObservingTrends in Functional Programming10.1007/978-3-319-14675-1_6(84-103)Online publication date: 27-Dec-2014
    • Show More Cited By

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media