skip to main content
research-article

Nameless, painless

Published:19 September 2011Publication History
Skip Abstract Section

Abstract

De Bruijn indices are a well known technique for programming with names and binders. They provide a representation that is both simple and canonical.

However, programming errors tend to be really easy to make. We propose a safer programming interface implemented as a library. Whereas indexing the types of names and terms by a numerical bound is a famous technique, we index them by worlds, a different notion of index that is both finer and more abstract. While being more finely typed, our approach incurs no loss of expressiveness or efficiency.

Via parametricity we obtain properties about functions polymorphic on worlds. For instance, well-typed world-polymorphic functions over open λ-terms commute with any renaming of the free variables.

Our whole development is conducted within Agda, from the code of the library, to its soundness proof and the properties of external functions. The soundness of our library is demonstrated via the construction of a logical relations argument.

Skip Supplemental Material Section

Supplemental Material

_talk5.mp4

References

  1. Thorsten Altenkirch. A formalization of the strong normalization proof for System F in LEGO. In J. F. Groote M. Bezem, editor, Typed Lambda Calculi and Applications, LNCS 664, pages 13--28, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Thorsten Altenkirch and Bernhard Reus. Monadic presentations of lambda terms using generalized inductive types. In Computer Science Logic, volume 1683 of Lecture Notes in Computer Science, pages 453--468. Springer, 1999. Google ScholarGoogle ScholarCross RefCross Ref
  3. Françoise Bellegarde and James Hook. Substitution: A formal methods case study using monads and transformations. Sci. Comput. Program., 23(2-3):287--311, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jean-Philippe Bernardy, Patrik Jansson, and Ross Paterson. Parametricity and dependent types. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP '10, pages 345--356, New York, NY, USA, 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Richard Bird and Ross Paterson. de Bruijn notation as a nested datatype. Journal of Functional Programming, 9(1):77--91, January 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Nicolaas G. de Bruijn. Lambda-calculus notation with nameless dummies: a tool for automatic formula manipulation with application to the Church-Rosser theorem. Indag. Math., 34(5):381--392, 1972.Google ScholarGoogle ScholarCross RefCross Ref
  7. Conor McBride and James McKinna. The view from the left. J. Funct. Program., 14:69--111, January 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Conor McBride and Ross Paterson. Applicative programming with effects. Journal of Functional Programming, 18(1):1--13, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Nicolas Pouillard. Nameless, painless (Agda code), 2011. http://tiny.nicolaspouillard.fr/NaPa.agda.Google ScholarGoogle Scholar
  10. Nicolas Pouillard and François Pottier. A fresh look at programming with names and binders. In Proceedings of the 15th ACM SIGPLAN international conference on Functional programming, ICFP '10, pages 217--228, New York, NY, USA, September 2010. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. John C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing 83, pages 513--523. Elsevier Science, 1983.Google ScholarGoogle Scholar
  12. Philip Wadler. Theorems for free! In Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 347--359, September 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Nameless, painless

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 46, Issue 9
        ICFP '11
        September 2011
        456 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2034574
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programming
          September 2011
          470 pages
          ISBN:9781450308656
          DOI:10.1145/2034773

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 19 September 2011

        Check for updates

        Qualifiers

        • research-article

      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!