Re: Parameterized signatures needed ?

From: Xavier Leroy (Xavier.Leroy@inria.fr)
Date: Thu Sep 16 1999 - 18:59:39 MET DST


Date: Thu, 16 Sep 1999 18:59:39 +0200
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Francois Pottier <Francois.Pottier@inria.fr>,
Subject: Re: Parameterized signatures needed ?
In-Reply-To: <19990914114600.57679@pauillac.inria.fr>; from Francois Pottier on Tue, Sep 14, 1999 at 11:46:00AM +0200

> In view of the
> solutions which exist at the level of expressions, one may suggest
> extending O'Caml with
>
> * either explicit sub-signature constraints, e.g.
>
> module d(X:sig
> module type B < sig type t end
> module F(a:A) : sig
> module b:B
> module c:C with type t = b.t
> end
> end) : ...

It looks like this would fit quite naturally within the OCaml module
system. After all, the module language is explicitely typed, has
subtyping and a form of parametric polymorphism; bounded polymorphism
is the next step. (I haven't checked the details, though.)

> * or row variables in signatures, although I am not sure which form
> this would take.

This looks less natural to me. A very limited form of "row
polymorphism" can already be expressed with module type parameters and
sub-structures, as in:

    module d(X:sig
                 module type X
                  module F(a:A) : sig
                      module b: sig type t module M: X end
                      module c:C with type t = b.t
                    end
                end) : ...

but it's very limited and not really practical.

- Xavier Leroy



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:25 MET