116
views
0
recommends
+1 Recommend
0 collections
    0
    shares
      • Record: found
      • Abstract: found
      • Article: found
      Is Open Access

      A Formal Comparison of Approaches to Datatype-Generic Programming

      Preprint
      ,

      Read this article at

      Bookmark
          There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience.

          Abstract

          Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic programming have been proposed over the years, most of them for Haskell, but recently also for dependently typed languages such as Agda. Different approaches vary in expressiveness, ease of use, and implementation techniques. Some work has been done in comparing the different approaches informally. However, to our knowledge there have been no attempts to formally prove relations between different approaches. We thus present a formal comparison of generic programming libraries. We show how to formalise different approaches in Agda, including a coinductive representation, and then establish theorems that relate the approaches to each other. We provide constructive proofs of inclusion of one approach in another that can be used to convert between approaches, helping to reduce code duplication across different libraries. Our formalisation also helps in providing a clear picture of the potential of each approach, especially in relating different generic views and their expressiveness.

          Related collections

          Most cited references17

          • Record: found
          • Abstract: not found
          • Book Chapter: not found

          Functional programming with bananas, lenses, envelopes and barbed wire

            Bookmark
            • Record: found
            • Abstract: not found
            • Book Chapter: not found

            Dependently Typed Programming in Agda

            Ulf Norell (2009)
              Bookmark
              • Record: found
              • Abstract: not found
              • Conference Proceedings: not found

              PolyP---a polytypic programming language extension

                Bookmark

                Author and article information

                Journal
                13 February 2012
                Article
                10.4204/EPTCS.76.6
                1202.2920
                368fb9bc-6d8f-4e0d-9879-28821fa64508

                http://arxiv.org/licenses/nonexclusive-distrib/1.0/

                History
                Custom metadata
                EPTCS 76, 2012, pp. 50-67
                In Proceedings MSFP 2012, arXiv:1202.2407
                cs.PL
                EPTCS

                Comments

                Comment on this article