skip to main content
10.1145/1111037.1111047acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Polymorphic regular tree types and patterns

Published:11 January 2006Publication History

ABSTRACT

We propose a type system based on regular tree grammars, where algebraic datatypes are interpreted in a structural way. Thus, the same constructors can be reused for different types and a flexible subtyping relation can be defined between types, corresponding to the inclusion of their semantics. For instance, one can define a type for lists and a subtype of this type corresponding to lists of even length. Patterns are simply types annotated with binders. This provides a generalization of algebraic patterns with the ability of matching arbitrarily deep in a value. Our main contribution, compared to languages such as XDuce and CDuce, is that we are able to deal with both polymorphism and function types.

References

  1. M. Brandt and F. Henglein. Coinductive axiomatization of recursive type equality and subtyping. In R. Hindley, editor, Proc. 3d Int'l Conf. on Typed Lambda Calculi and Applications (TLCA), Nancy, France, April 2-4, 1997, volume 1210 of Lecture Notes in Computer Science (LNCS), pages 63--81. Springer-Verlag, April 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Cartwright. Types as intervals. In Proceedings of the 12th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 22--36. ACM Press, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. CDuce Development Team. CDuce Programming Language User's Manual. Available from http://www.cduce.org/documentation.html.Google ScholarGoogle Scholar
  4. A. Frisch. Théorie, conception et réalisation d'un langage adapté à XML. Thèse de doctorat, University of Paris 7, 2004.Google ScholarGoogle Scholar
  5. V. Gapeyev, M. Levin, and B. Pierce. Recursive subtyping revealed. Journal of Functional Programming, 12(6):511--548, 2003. Preliminary version in ICFP 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. H. Hosoya, A. Frisch, and G. Castagna. Parametric polymorphism for XML. In POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT sysposium on Principles of programming languages, pages 50--62. ACM Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. H. Hosoya and B. C. Pierce. XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology, 3(2):117--148, May 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. H. Hosoya, J. Vouillon, and B. C. Pierce. Regular expression types for XML. ACM Trans. Program. Lang. Syst., 27(1):46--90, 2005. Short version in ICFP 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Y. Levin. Compiling regular patterns. In ICFP '03: Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, pages 65--77, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. C. Reynolds. Types, abstraction, and parametric polymorphism. In R. E. A. Mason, editor, Information Processing 83, pages 513--523, Amsterdam, 1983. Elsevier Science Publishers B. V. (North-Holland).Google ScholarGoogle Scholar
  11. A. K. Wright. Simple imperative polymorphism. Lisp Symb. Comput., 8(4):343--355, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Polymorphic regular tree types and patterns

          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

          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!