## Private row types: Abstracting the unnamed

### Cached

### Download Links

- [www.math.nagoya-u.ac.jp]
- [www.math.nagoya-u.ac.jp]
- DBLP

### Other Repositories/Bibliography

Venue: | of Lecture Notes in Computer Science |

Citations: | 1 - 0 self |

### BibTeX

@INPROCEEDINGS{Garrigue_privaterow,

author = {Jacques Garrigue},

title = {Private row types: Abstracting the unnamed},

booktitle = {of Lecture Notes in Computer Science},

year = {},

pages = {44--60},

publisher = {Springer}

}

### OpenURL

### Abstract

In addition to traditional record and variant types, Objective Caml has structurally polymorphic types, for objects and polymorphic variants. These types allow new forms of polymorphic programming, but they have a limitation when used in combination with modules: there is no way to abstract their polymorphism in a signature. Private row types remedy to this situation: they are manifest types whose “row-variable ” is left abstract, so that an implementation may instantiate it freely. They have useful applications even in the absence of functors. Combined with recursive modules, they provide an original solution to the expression problem. 1

### Citations

358 | Making the future safe for the past: Adding genericity to the Java programming language
- Bracha, Odersky, et al.
- 1998
(Show Context)
Citation Context ...yping: one might allow defining upper or lower bounds for abstract types. This is the idea behind F-bounded polymorphism [3], which has been integrated into a number of languages such as Generic Java =-=[2]-=-, Moby [5], or Scala [11]. In particular, Moby and Scala do have a module system able to express functors, and Scala gives an elegant solution to the expression problem [19]. We avoided F-bounded poly... |

141 |
F-bounded polymorphism for object-oriented programming
- Canning, Cook, et al.
- 1989
(Show Context)
Citation Context ...ined. One option to introduce such semi-abstract types would be to exploit subtyping: one might allow defining upper or lower bounds for abstract types. This is the idea behind F-bounded polymorphism =-=[3]-=-, which has been integrated into a number of languages such as Generic Java [2], Moby [5], or Scala [11]. In particular, Moby and Scala do have a module system able to express functors, and Scala give... |

108 | Applicative functors and fully transparent higher-order modules
- Leroy
- 1995
(Show Context)
Citation Context ...rmal system underlying private row types. It is based on our formalism for structural polymorphism [8] for the core language part, combined with Leroy’s description of an applicative functor calculus =-=[9]-=-. We will not give full details of these two systems, as both of them are rather complex, yet very few changes are actually needed. In order to introduce private row types, we only need two things. On... |

101 | A nominal theory of objects with dependent types
- Odersky, Cremet, et al.
- 2003
(Show Context)
Citation Context ...efining upper or lower bounds for abstract types. This is the idea behind F-bounded polymorphism [3], which has been integrated into a number of languages such as Generic Java [2], Moby [5], or Scala =-=[11]-=-. In particular, Moby and Scala do have a module system able to express functors, and Scala gives an elegant solution to the expression problem [19]. We avoided F-bounded polymorhism, because subtypin... |

90 | What is a recursive module
- Crary, Harper, et al.
- 1999
(Show Context)
Citation Context ...wing incremental extension. As this feature relies heavily on the expressive power of modules, it is most interesting when combined with recent extensions of module systems, such as recursive modules =-=[4, 16]-=- or, in an hopefully close future, combinable signatures [13]. While we have already considered a large number of examples using private polymorphic variants types, the interaction of private row type... |

83 | Type inference for records in a natural extension of ML
- Rémy
- 1993
(Show Context)
Citation Context ... 3 Formalization Before giving a complete formalization, we first describe a much simpler one, which is limited to private object types. The idea is to formalize objects as rows, in the style of Rémy =-=[16]-=-. Here are our core types. ν ::= α | t(τρ) τ ::= ν | τ → τ |〈ρ〉 ρ ::= ν | /0 | l : τ;ρ k ::= ⋆ |⋄ σ ::= τ |∀α:k.σ abstractions types rows kinds polytypes Types are composed of abstractions, function... |

82 | The Design of a Class Mechanism for Moby
- Fisher, Reppy
- 1999
(Show Context)
Citation Context ... might allow defining upper or lower bounds for abstract types. This is the idea behind F-bounded polymorphism [3], which has been integrated into a number of languages such as Generic Java [2], Moby =-=[5]-=-, or Scala [11]. In particular, Moby and Scala do have a module system able to express functors, and Scala gives an elegant solution to the expression problem [19]. We avoided F-bounded polymorhism, b... |

80 | A modular module system
- Leroy
(Show Context)
Citation Context ...th this core type system, moving to the module level is trivial: we just need to add kinds to abstract types. This creates no difficulty, as Leroy’s modular module system already handles simple kinds =-=[18]-=-. In such a system, the signature OVect would be: module type OVect = sig type t_row : ⋄ type t : ⋆ = <length: int; get: int → float; t_row> val init : int → (int → float) → t end Then defining a part... |

76 | A polymorphic record calculus and its compilation
- Ohori
- 1995
(Show Context)
Citation Context ... as one can only refine them by adding new methods, but this is impossible for variant types, as existing constructors may also disappear. For this reason, the formalism we use here is based on kinds =-=[12]-=- rather than row variables, but we will still use an abstract type representing a “virtual” row variable. 3.1 Core type system We will directly use the formalism from [8], as it is already general eno... |

64 | Recursive structures for Standard ML
- Russo
- 2001
(Show Context)
Citation Context ...wing incremental extension. As this feature relies heavily on the expressive power of modules, it is most interesting when combined with recent extensions of module systems, such as recursive modules =-=[4, 16]-=- or, in an hopefully close future, combinable signatures [13]. While we have already considered a large number of examples using private polymorphic variants types, the interaction of private row type... |

57 | Objective ML: An effective object-oriented extension to ML. Theory And Practice of Objects Systems
- Rémy, Vouillon
- 1998
(Show Context)
Citation Context ...ml, allow new forms of polymorphic programming. For instance, a function may take an object as parameter, and call some of its methods, without knowing its exact type, or even the list of its methods =-=[15]-=-. Similarly, a list of polymorphic variant values can be used in different contexts expecting different numbers of constructors, as long as the types of constructor arguments agree, and all constructo... |

49 | Odersky, Independently Extensible Solutions to the Expression Problem
- Zenger, Martin
- 2004
(Show Context)
Citation Context ...guages such as Generic Java [2], Moby [5], or Scala [11]. In particular, Moby and Scala do have a module system able to express functors, and Scala gives an elegant solution to the expression problem =-=[19]-=-. We avoided F-bounded polymorhism, because subtyping in Objective Caml is fully explicit: any use of a value whose type is semi-abstract would have required a coercion. We rather chose to stick with ... |

46 | Programming with polymorphic variants
- Garrigue
- 1998
(Show Context)
Citation Context ...variant values can be used in different contexts expecting different numbers of constructors, as long as the types of constructor arguments agree, and all constructors present in the list are allowed =-=[6]-=-. These new types are particularly interesting in programming situations where one gradually extends a type witha new methods or constructors. This is typically supported by classes for objects, but t... |

44 | Odersky, Extensible algebraic datatypes with defaults
- Zenger, Martin
- 2001
(Show Context)
Citation Context ...n-matching on X.t needs to contain a default case, as it may actually contain more cases than basic. This is similar to Zenger&Odersky’s approach to extensible datatypes, which also requires defaults =-=[18]-=-. In order to extend this basic property type, we only need to define a new type and apply the functor. Here we show interactive definitions at the toplevel, including the types inferred by the compil... |

34 | Code reuse through polymorphic variants
- Garrigue
- 2000
(Show Context)
Citation Context ...perations [17]. This problem is notoriously difficult to solve, and Objective Caml was, to the best of our knowledge, the first language to do it in a type safe way, using either polymorphic variants =-=[7]-=- or classes [14]. If we think of these situations as examples of incremental modular programming, we realize that an essential ML feature does not appear in this picture: functors. This is surprising,... |

20 |
The Objective Caml system, release 3.08, Documentation and user’s manual. http://caml.inria.fr/ocaml/htmlman/index.html
- Leroy
- 2004
(Show Context)
Citation Context ...llowing to use several property bases in the same program for instance. 2.2 Relation to private types Since version 3.07, released in 2003, Objective Caml has private types, introduced by Pierre Weis =-=[10]-=-. Like private row types, private types are intended to appear in signatures, abstracting some behavior of the implementation. To do that, they simply restrict (non-polymorphic) variants and records, ... |

15 |
The Objective Caml system, release 3.09. documentation and user’s
- Leroy, Doligez, et al.
- 2004
(Show Context)
Citation Context ...llowing to use several property bases in the same program for instance. 2.2 Relation to Private Types Since version 3.07, released in 2003, Objective Caml has private types, introduced by Pierre Weis =-=[14]-=-. Like private row types, private types are intended to appear in signatures, abstracting some behavior of the implementation. To do that, they simply restrict (non-polymorphic) variants and records, ... |

15 | Recursive modules for programming
- Nakata, Garrigue
- 2006
(Show Context)
Citation Context ...wing incremental extension. As this feature relies heavily on the expressive power of modules, it is most interesting when combined with recent extensions of module systems, such as recursive modules =-=[22,23,24]-=- or, in an hopefully close future, combinable signatures [21]. Another desirable addition is support for unions of private variant types. One can already define unions of concrete polymorphic variant ... |

12 |
Combining subsumption and binary methods: An object calculus with views
- Vouillon
- 2001
(Show Context)
Citation Context ...r.c, calling v#get i always succeeds when 0 ≤ i < v#length. Note that private object types do not interact directly with classes, and as such they are not as expressive as abstract views for instance =-=[15]-=-. In particular one cannot inherit from a private type. 2.3 Recursion and the Expression Problem Examples in previous sections have kept to a simple structure. In particular, the variant types involve... |

11 |
The expression problem. Java Genericity Mailing List
- Wadler
- 1998
(Show Context)
Citation Context ...s to allow extension. A typical example of this style is the expression problem, where one progressively and simultaneoulsy enriches a small expression language with new constructs and new operations =-=[17]-=-. This problem is notoriously difficult to solve, and Objective Caml was, to the best of our knowledge, the first language to do it in a type safe way, using either polymorphic variants [7] or classes... |

9 | Simple type inference for structural polymorphism
- Garrigue
- 2002
(Show Context)
Citation Context ...type σ ::= θ | ∀�α.θ polytype Figure 1: Types and kinds We provide here a short description of the formal system underlying private row types. It is based on our formalism for structural polymorphism =-=[8]-=- for the core language part, combined with Leroy’s description of an applicative functor calculus [9]. We will not give full details of these two systems, as both of them are rather complex, yet very ... |

8 |
P.: An expressive language of signatures
- Ramsey, Fisher, et al.
- 2005
(Show Context)
Citation Context ... to allow private row types, particularly recursive ones. This is not yet enough for mutually recursive types, and it seems that there are approaches more promising than with to manipulate signatures =-=[13]-=-. A last design decision is related to the handling of variance. In order to allow more subtyping, in OCaml both abstract types and algebraic datatypes have variances associated to their type paramete... |

5 |
The typed polymorphic label-selective λ -calculus
- Garrigue, Aït-Kaci
- 1994
(Show Context)
Citation Context ... two kinds: ⋆ for types and ⋄ for rows. We allow fields to commute in rows, that is l1 : τ1;l2 : τ2;ρ = l2 : τ2;l1 : τ1;ρ if l1 = l2 The same label may occur twice in a row (as for labeled arguments =-=[17]-=-.) This simplifies kinds —they don’t need to track which labels are used—, but this has no practical impact, as there is no way to create such an object. If we start with this core type system, moving... |

4 |
On the expression problem. http://pauillac.inria.fr/ ~remy /work/expr/(2004
- Rémy, Garrigue
(Show Context)
Citation Context ... This problem is notoriously difficult to solve, and Objective Caml was, to the best of our knowledge, the first language to do it in a type safe way, using either polymorphic variants [4] or classes =-=[5]-=-. If we think of these situations as examples of incremental modular programming, we realize that an essential ML feature does not appear in this picture: functors. This is surprising, as they are sup... |

1 | Polymorphic data types, objects, modules and functors: is it too much
- Boulmé, Hardin, et al.
- 2000
(Show Context)
Citation Context ...ribes a correct intuition, while formalization is a bit trickier. There has been examples in the past combining classes with functors. Such a combination has been used by the FOC project for instance =-=[1]-=-. But in the absence of private row types, classes were only used to provide late-binding at the value level, and classes or object types did not appear in parameters of functors. We will also see tha... |

1 |
On the expression problem (2004), http://pauillac.inria.fr /~remy/work/expr
- Rémy, Garrigue
(Show Context)
Citation Context ... This problem is notoriously difficult to solve, and Objective Caml was, to the best of our knowledge, the first language to do it in a type safe way, using either polymorphic variants [7] or classes =-=[14]-=-. If we think of these situations as examples of incremental modular programming, we realize that an essential ML feature does not appear in this picture: functors. This is surprising, as they are sup... |