skip to main content
10.1145/507635.507648acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Generic unification via two-level types and parameterized modules

Published:01 October 2001Publication History

ABSTRACT

As a functional pearl, we describe an efficient, modularized implementation of unification using the state of mutable reference cells to encode substitutions. We abstract our algorithms along two dimensions, first abstracting away from the structure of the terms to be unified, and second over the monad in which the mutable state is encapsulated. We choose this example to illustrate two important techniques that we believe many functional programmers would find useful. The first of these is the definition of recursive data types using two levels: a structure defining level, and a recursive knot-tying level. The second is the use of rank-2 polymorphism inside Haskell's record types to implement a form of type parameterized modules.

References

  1. L. Cardelli. Basic polymorphic typechecking.Scuence of Computer Programinvag, 8(2):117172, Apr. 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In ACM, editor, Confe,tnce record of POPL '94, 21st ACM SJC1'LAIVSIGACT Symposium on Prtiezples of Programming Languages: papers presented at the Symposium: Portland. Oregon, January 17-21, 1994, pages 123-137. New York. NY, USA, 1994. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Harper and B. C. Pierce. Advanced module systems (invited talk): a guide for the perplexed. ACM SIGPLAN Notices. 35(9):130-130, Sept. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Hinze. Memo functions, polytypically! In J. Jeuring, editor, Proceedings 2nd Workshop on Generic Programming. WCP'2000, Ponte de Lima. Portugal, 6 July 2000, Tech. Report UU-CS2000-19. Dept. of Computer Science, Utrecht Univ., pages 17 32. June 2000.]]Google ScholarGoogle Scholar
  5. R. Hinze. A new approach to generic functional programming. In Proceedings of the 27th ACM SIGPLAN-SIGACI' Symposium on Principles of Programming Languages (POLP-00), pages 119-132, N.Y., Jan. 19-21 2000. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. Jansson and J. Jeuring. Polyp - a polytypic programming language extension. In ACM. editor. Conference record of POPL 97 the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages: papers presented at the symposium. Paris, France, 15-17 January 1997. pages 470-482, New York, NY. USA, 1997. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Jansson and J. Jeuring. Functional pearl: Polytypie unification. Journal of Functional Programming, 8(5):527-536. Sept. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Jeuring and P. Jansson. Polytypic programming. In J. Launchbury, E. Meijer, and T. Sheard, editors. Tutorial Text 2nd Int. School on Advanced Functional Programming. Olympia, WA, USA, 26-30 Aug 1996. volume 1129 of Lecture Notes in Computer Science, pages 68-114. Springer-Verlag, Berlin, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Jones. Type classes and functional dependencies. In Proceedings of the 9th European Symposium on Programming. ESOP 2000, volume LNCS 1782. Springer-Verlag. March 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. P. Jones. Using parameterized signatures to express modular structure. In 23rd ACM SJCPLAN-SIGACJ' Symposium on Principles of Programming Languages (POPL '96), pages 6878. St. Petersburg Beach, Florida, 21-24 Jan. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. P. Jones. Typing haskell in haskell. In Proceedings of the 1999 Haskell Workshop. pages 68-78, Paris, France, 21-24 Oct. 1999. Published in Technical Report UU-CS-1999-28, Department of Computer Science, University of Utrecht.]]Google ScholarGoogle Scholar
  12. J. Launchbury and S. Peyton-Jones. Lazy functional state threads. In PLDI'94: Programming Language Design and Implementation, Orlando, Florida, pages 24-35, New York, June 1994. ACM Press.]] Google ScholarGoogle ScholarCross RefCross Ref
  13. M. Odersky and K. Lufer. Putting type annotations to work. In ACM, editor, Conference record of POLL '96, 23rd ACM SIGPLAN-SICACJ' Symposium on Principles of Programming Languages: papers presented at the Symposium: St. Petersburg Beach, Florida, 21-24 January 1996, pages 5467, New York, NY, USA, 1996. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generic unification via two-level types and parameterized modules

        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
          ICFP '01: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
          October 2001
          277 pages
          ISBN:1581134150
          DOI:10.1145/507635
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 36, Issue 10
            October 2001
            276 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/507669
            Issue’s Table of Contents

          Copyright © 2001 ACM

          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]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 October 2001

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          ICFP '01 Paper Acceptance Rate23of66submissions,35%Overall Acceptance Rate333of1,064submissions,31%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader