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 2008Publication History

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.

Skip Supplemental Material Section

Supplemental Material

Video

References

  1. F. Atanassow and J. Jeuring. Inferring type isomorphisms generically. In MPC'04, LNCS 3125, pages 32--53, 2004.Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  3. R. Bird and L. Meertens. Nested datatypes. In J. Jeuring, editor, MPC'98, LNCS 1422, pages 52--67, 1998. Google ScholarGoogle Scholar
  4. B. Bringert and A. Ranta. A pattern for almost compositional functions. In ICFP'06, pages 216--226, 2006. Google ScholarGoogle Scholar
  5. J. Cheney and R. Hinze. A lightweight implementation of generics and dynamics. In Haskell'02, pages 90--104, 2002. Google ScholarGoogle Scholar
  6. K. Claessen and J. Hughes. QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs. In ICFP'00, pages 286--279, 2000. Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  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/.Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  10. Haskell Generic Library list. Generic programming criteria template, 2008. Wiki page at haskell.org/haskellwiki/Applications_and_libraries/Generic_programming.Google ScholarGoogle Scholar
  11. T. Haskell Prime list. Haskell prime, 2006. Wiki page at http://hackage.haskell.org/trac/haskell-prime.Google ScholarGoogle Scholar
  12. R. Hinze. Generics for the masses. Journal of Functional Programming, 16:451--482, 2006. Google ScholarGoogle Scholar
  13. R. Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43(2-3):129--159, 2002.Google ScholarGoogle Scholar
  14. R. Hinze and A. Löh. "Scrap Your Boilerplate" revolutions. In MPC'06, LNCS 4014, pages 180--208, 2006. Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Jansson and J. Jeuring. PolyP - a polytypic programming language extension. In POPL'97, pages 470--482, 1997. Google ScholarGoogle Scholar
  20. P. Jansson and J. Jeuring. Polytypic data conversion programs. Science of Computer Programming, 43(1):35--75, 2002. Google ScholarGoogle Scholar
  21. P. Jansson and J. Jeuring. PolyLib - a polytypic function library. Workshop on Generic Programming, Marstrand, 1998.Google ScholarGoogle Scholar
  22. O. Kiselyov. Smash your boilerplate without class and typeable. http://article.gmane.org/gmane.comp.lang.haskell.general/14086, 2006.Google ScholarGoogle Scholar
  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. Google ScholarGoogle Scholar
  24. R. Lämmel and S. Peyton Jones. Scrap your boilerplate: a practical approach to generic programming. In TLDI, pages 26--37, 2003.Google ScholarGoogle Scholar
  25. R. Lämmel and S. Peyton Jones. Scrap more boilerplate: reflection, zips, and generalised casts. In ICFP, pages 244--255, 2004.Google ScholarGoogle Scholar
  26. R. Lämmel and S. Peyton Jones. Scrap your boilerplate with class: extensible generic functions. In ICFP, pages 204--215, 2005.Google ScholarGoogle Scholar
  27. R. Lämmel and J. Visser. A Strafunski Application Letter. In PADL'03, LNCS 2562, pages 357--375, 2003. Google ScholarGoogle Scholar
  28. R. Lämmel and J. Visser. Typed combinators for generic traversal. In PADL'02, LNCS 2257, pages 137--154, 2002. Google ScholarGoogle Scholar
  29. H. Li, C. Reinke, and S. Thompson. Tool support for refactoring functional programs. In Haskell'03, pages 27--38, 2003. Google ScholarGoogle Scholar
  30. A. Löh, D. Clarke, and J. Jeuring. Depency-style Generic Haskell. In ICFP'03, pages 141--152, 2003. Google ScholarGoogle Scholar
  31. I. Lynagh. Template Haskell: A report from the field. http://www.comlab.ox.ac.uk/oucl/work/ian.lynagh/papers/, 2003.Google ScholarGoogle Scholar
  32. L. Meertens. Calculate polytypically! In H. Kuchen and S. D. Swierstra, editors, PLILP, LNCS 1140, pages 1--16, 1996. Google ScholarGoogle Scholar
  33. N. Mitchell and C. Runciman. A static checker for safe pattern matching in Haskell. In Trends in Functional Programming, volume 6. Intellect, 2007a.Google ScholarGoogle Scholar
  34. N. Mitchell and C. Runciman. Uniform boilerplate and list processing. In Haskell'07, 2007b. Google ScholarGoogle Scholar
  35. M. Naylor and C. Runciman. Finding inputs that reach a target expression. In SCAM'07, pages 133--142, 2007. Google ScholarGoogle Scholar
  36. U. Norell and P. Jansson. Polytypic programming in Haskell. In IFL'03, LNCS 3145, pages 168--184, 2004. Google ScholarGoogle Scholar

Index Terms

  1. Comparing libraries for generic programming in haskell

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • 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

        Copyright © 2008 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 25 September 2008

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Haskell '08 Paper Acceptance Rate13of28submissions,46%Overall Acceptance Rate57of143submissions,40%

        Upcoming Conference

        ICFP '23

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!