## Guarded Recursive Datatype Constructors (2003)

### Cached

### Download Links

Citations: | 133 - 10 self |

### BibTeX

@MISC{Xi03guardedrecursive,

author = {Hongwei Xi and Chiyan Chen and Gang Chen},

title = {Guarded Recursive Datatype Constructors},

year = {2003}

}

### Years of Citing Articles

### OpenURL

### Abstract

introduc e a notion of guarded rec ursive (g.r.) datatype c#w struc tors, generalizing the notion ofrec# rsive datatypes in func tional programming languages suc h as ML and Haskell. We address both theoret ic#t and prac# ic## issues resulted from this generalization. On one hand, we design a type system to formalize the notion of g.r. datatypec onstruc - tors and then prove the soundness of the type system. On the other hand, we present some signific ant applic ations (e.g., implementing objec ts, implementing stagedc omputation, etc# ) of g.r. datatype c# nstruc#S rs, arguing that g.r. datatypec onstruc torsc an have far-reac hingc onsequenc es in programming. The mainc ontribution of the paper lies in the rec#I0 ition and then the formalization of a programming notion that is of both theoretic# l interest and prac tic# l use.

### Citations

1631 | The Definition of Standard ML
- Milner, Tofte, et al.
- 1997
(Show Context)
Citation Context ...eq) indicates that the type equality in #2,G is modulo type constraint solving. Please notice the great di#erence between the rules presented in Figure 3 for typing clauses and the "standard"=-=; ones in [14]-=-. We form the dynamic semantics of #2,G through the use of evaluation contexts, which are defined below. Evaluation context E ::= [] | fst(E) | snd(E) | #E, e# | #v, E# | E(e) | v(E) | E[# ] | let x =... |

1354 |
Smalltalk-80: The Language and its Implementation
- Goldberg, Robson
- 1983
(Show Context)
Citation Context ... methods, the self type, etc.) in a purely type-theoretical manner, which we feel is both natural and satisfactory. In the following presentation, we take a view of objects in the spirit of Smalltalk =-=[9, 13]-=-, suggesting to conceptualize an object as a little intelligent being that is capable of performing actions according to the messages it receives. We assume the existence of a guarded recursive dataty... |

303 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ...nteresting applications of g.r. datatype constructors in capturing program invariants. In particular, we show that g.r. datatype constructors can be combined with a restricted form of dependent types =-=[25, 23]-=- to type programming objects, overcoming some significant deficiencies in many existing type systems for object-oriented programming [2]. In summary, we present a generalization of the notion of recur... |

262 | Compiling polymorphism using intensional type analysis
- Harper, Morrisett
- 1995
(Show Context)
Citation Context ... such a function, we need to analyze the types of values at run-time. With run-time type analysis, we can also support various advanced implementation techniques such as flattened data representation =-=[10]-=-, polymorphic marshaling [16], unboxed function arguments [12], tag-free garbage collection [20], etc. A (conceptually) simple and direct approach to run-time type analysis is to pass types or, more p... |

257 | Multi-stage programming with explicit annotations
- Taha, Sheard
- 1997
(Show Context)
Citation Context ...# #, indicating that the evaluation of higher-order abstract syntax trees is type-preserving. Later, we will show that the type constructorsHOAS can play a key role in implementing staged computation =-=[7, 19]-=-. The introduction of g.r. datatype constructors raises a number of theoretical and practical issues. We briefly outline our results and design decisions. The first and foremost issue that arises is t... |

199 | A modal analysis of staged computation
- Davies, Pfenning
(Show Context)
Citation Context ...# #, indicating that the evaluation of higher-order abstract syntax trees is type-preserving. Later, we will show that the type constructorsHOAS can play a key role in implementing staged computation =-=[7, 19]-=-. The introduction of g.r. datatype constructors raises a number of theoretical and practical issues. We briefly outline our results and design decisions. The first and foremost issue that arises is t... |

173 | Unboxed objects and polymorphic typing
- Leroy
- 1992
(Show Context)
Citation Context ...n-time. With run-time type analysis, we can also support various advanced implementation techniques such as flattened data representation [10], polymorphic marshaling [16], unboxed function arguments =-=[12]-=-, tag-free garbage collection [20], etc. A (conceptually) simple and direct approach to run-time type analysis is to pass types or, more precisely, terms representing types at run-time and then inspec... |

144 | Intensional polymorphism in type-erasure semantics
- Crary, Weirich, et al.
- 1999
(Show Context)
Citation Context ...lause in the definition is a type annotation, which assigns the type ##.(#)TY # # # string to the defined function val2string. The above idea of using terms to represent types can already be found in =-=[6, 22]-=-, where a typed calculus #R is introduced to facilitate type-passing. The type constructor R in #R corresponds to TY, and its associated value constructors Rint , R , R# and RR correspond to TYint, TY... |

82 | Flexible type analysis
- Crary, Weirich
- 1999
(Show Context)
Citation Context ...D CONCLUSION Our work is related to both intentional polymorphism and type classes. There have already been a rich body of studies in the literature on passing types at run-time in a type-safe manner =-=[6, 5, 21]-=-. Many of such studies follow the framework in [10], which essentially provides a construct typecase at term level to perform type analysis and a primitive recursor Typerec over type names at type lev... |

65 | Tag-free garbage collection using explicit type parameters
- Tolmach
- 1994
(Show Context)
Citation Context ...s, we can also support various advanced implementation techniques such as flattened data representation [10], polymorphic marshaling [16], unboxed function arguments [12], tag-free garbage collection =-=[20]-=-, etc. A (conceptually) simple and direct approach to run-time type analysis is to pass types or, more precisely, terms representing types at run-time and then inspect the structure of such terms. In ... |

62 | Polymorphic type inference and abstract data types
- LĂ¤ufer, Odersky
- 1994
(Show Context)
Citation Context ...llowing syntax typecon TOP = Top of 'a declares a value constructor Top of the type ##.# # TOP; TOP is defined as t.#{#}.#, which is equivalent to ##.#. The type TOP is called an abstract datatype in =-=[11]-=-. In general, the the notion of abstract datatypes is subsumed by the notion of g.r. datatype constructors. Example 2 The following syntax typecon (type) list = ('a) nil | ('a) cons of 'a * 'a list de... |

45 | Implementing haskell overloading
- Augustsson
- 1993
(Show Context)
Citation Context ...in practice. A common approach to implementing type classes is through dictionary-passing, where a dictionary is essentially a record of the member functions for a particular instance of a type class =-=[1]-=-. We encountered the notion of g.r. datatype constructors when seeking an alternative implementation of type classes through intensional polymorphism. An approach to implementing type classes through ... |

44 | Fully reflexive intensional type analysis
- Trifonov, Saha, et al.
- 2000
(Show Context)
Citation Context ...D CONCLUSION Our work is related to both intentional polymorphism and type classes. There have already been a rich body of studies in the literature on passing types at run-time in a type-safe manner =-=[6, 5, 21]-=-. Many of such studies follow the framework in [10], which essentially provides a construct typecase at term level to perform type analysis and a primitive recursor Typerec over type names at type lev... |

37 |
Extensional polymorphism
- Dubois, Rouaix, et al.
- 1995
(Show Context)
Citation Context ...ueue in message-passing style, an implementation of polymorphic marshaling as is described in [16], etc. 4.1 Polymorphic Generic Functions The notion of polymorphic generic functions is introduced in =-=[8]-=-, which allows the programmer to define polymorphic functions that may behave di#erently on di#erent type arguments. We use an example to show that generic functions can be readily handled through the... |

36 | Semantics for communication primitives in a polymorphic language
- Ohori, Kato
- 1993
(Show Context)
Citation Context ...analyze the types of values at run-time. With run-time type analysis, we can also support various advanced implementation techniques such as flattened data representation [10], polymorphic marshaling =-=[16]-=-, unboxed function arguments [12], tag-free garbage collection [20], etc. A (conceptually) simple and direct approach to run-time type analysis is to pass types or, more precisely, terms representing ... |

36 | Encoding intensional type analysis
- Weirich
- 2001
(Show Context)
Citation Context ...lause in the definition is a type annotation, which assigns the type ##.(#)TY # # # string to the defined function val2string. The above idea of using terms to represent types can already be found in =-=[6, 22]-=-, where a typed calculus #R is introduced to facilitate type-passing. The type constructor R in #R corresponds to TY, and its associated value constructors Rint , R , R# and RR correspond to TYint, TY... |

31 | Computation and Deduction
- Pfenning
- 1997
(Show Context)
Citation Context ...r, and the value constructors associated with HOAS are assigned the types in Figure 1. The type constructor HOAS, which is intended to construct types for a form of higher-order abstract syntax trees =-=[4, 18]-=-, cannot be inductively defined because of the type of the value constructor HOASfix. Given a type # , (# )HOAS is the type for higherorder abstract syntax trees representing monomorphically typed exp... |

27 | et al. Haskell 98: A non-strict, purely functional language - Jones, Hughes - 1999 |

17 | A functional notation for functional dependencies
- Neubauer, Thiemann, et al.
- 2001
(Show Context)
Citation Context ...er 1 and the character a. Certainly, a functions like sprintf can also be implemented through the use of type classes (or their variants). The above implementation of sprintf is actually adopted from =-=[15]-=-. In this case, the format argument of the sprintf function is most likely to be provided by the user instead of being automatically synthesized and the very issue of overloading addressed by type cla... |

14 |
Foundations of Object-Oriented Languages
- Bruce
- 2002
(Show Context)
Citation Context ... can be combined with a restricted form of dependent types [25, 23] to type programming objects, overcoming some significant deficiencies in many existing type systems for object-oriented programming =-=[2]-=-. In summary, we present a generalization of the notion of recursive datatypes, allowing the programmer to form g.r. datatype constructors. The most significant contribution of the paper lies in the r... |

9 |
A formulation of the simple type theory of types
- Church
- 1940
(Show Context)
Citation Context ...r, and the value constructors associated with HOAS are assigned the types in Figure 1. The type constructor HOAS, which is intended to construct types for a form of higher-order abstract syntax trees =-=[4, 18]-=-, cannot be inductively defined because of the type of the value constructor HOASfix. Given a type # , (# )HOAS is the type for higherorder abstract syntax trees representing monomorphically typed exp... |

4 |
Guarded Recursive Datatype Constructors, 2002. Available at http://www.cs.bu.edu/~hwxi/GRecTypecon
- Xi, Chen, et al.
(Show Context)
Citation Context ...mples in Section 4 to illustrate various applications of g.r. datatype constructors. Lastly, we mention some future research directions and related works. There is a full version of the paper on-line =-=[24]-=-, where various omitted details can be found. 2. THE LANGUAGE # 2,G We present a language #2,G based on the explicitly typed second-order polymorphic #-calculus. We present both static and dynamic sem... |

1 |
Implementing typed meta-programming. Available at http://www.cs.bu.edu/~hwxi/academic/papers/TMP.ps
- Chen, Xi
- 2002
(Show Context)
Citation Context ... a variable. It is of great di#culty to properly address the problem with open code extrusion. For an approach to implementing staged computation that can prevent open code extrusion, please refer to =-=[3]-=-, where a g.r. datatype constructor is formed for representing typed code via deBruijn indices. In [7], a language Mini-ML e with a type system based on the modal logic S4 is presented for studying st... |