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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- CDuce Development Team. CDuce Programming Language User's Manual. Available from http://www.cduce.org/documentation.html.Google Scholar
- A. Frisch. Théorie, conception et réalisation d'un langage adapté à XML. Thèse de doctorat, University of Paris 7, 2004.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- A. K. Wright. Simple imperative polymorphism. Lisp Symb. Comput., 8(4):343--355, 1995. Google Scholar
Digital Library
Index Terms
Polymorphic regular tree types and patterns
Recommendations
Polymorphic regular tree types and patterns
Proceedings of the 2006 POPL ConferenceWe 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, ...
On the power of coercion abstraction
POPL '12Erasable coercions in System F-eta, also known as retyping functions, are well-typed eta-expansions of the identity. They may change the type of terms without changing their behavior and can thus be erased before reduction. Coercions in F-eta can model ...
Optimal Representations of Polymorphic Types with Subtyping
Many type inference and program analysis systems include notions of subtyping and parametric polymorphism. When used together, these two features induce equivalences that allow types to be simplified by eliminating quantified variables. Eliminating ...







Comments