From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA17025; Tue, 30 Apr 2002 09:11:07 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA17021 for ; Tue, 30 Apr 2002 09:11:06 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3U77W520993; Tue, 30 Apr 2002 09:07:32 +0200 (MET DST) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA16979; Tue, 30 Apr 2002 09:07:32 +0200 (MET DST) Date: Tue, 30 Apr 2002 09:07:32 +0200 From: Francois Pottier To: Andreas Rossberg Cc: caml-list@inria.fr Subject: Re: [Caml-list] Polymorphic Variants and Number Parameterized Types Message-ID: <20020430090732.A16788@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <3CCD55BD.6DB352F5@ps.uni-sb.de> <20020429172853.A6314@pauillac.inria.fr> <3CCD794B.142F65D@ps.uni-sb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <3CCD794B.142F65D@ps.uni-sb.de>; from rossberg@ps.uni-sb.de on Mon, Apr 29, 2002 at 06:48:11PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi Andreas, On Mon, Apr 29, 2002 at 06:48:11PM +0200, Andreas Rossberg wrote: > > Well, if you have a functor like > > F : functor(X : sig module type S module Y:S end) -> ... > > then it would be polymorphic in an unknown number of types. Perhaps our views differ. What I gathered from Jones' and Russo's papers was that modules do not contain types. So, the module type S cannot be a component of X; rather, the type of the functor F will be universally quantified over S. This leads me to something like: F : forall S. functor (X : S) -> ... where the distinction between X and Y is eliminated, because it becomes superfluous. In fact, the `functor' syntax and the name X are just sugar, since a functor is a function. So I would really write F : forall S. S -> ... > The application > > F (struct module type S = sig type t type u val x : t end > module Y = struct type t = int > type u = bool > val x = 7 end > end) > > corresponds to something like > > F {t:*,u:*} {x:int} {t=int,u=bool} {Y={x=7}} I would simply apply F { x : int } { x = 7 } or, perhaps (if abstraction is desired) F (exists t,u.{ x : t }) (pack { x = 7 } as exists t,u.{ x : t }) So, in this example, we seem to need neither higher kinds nor kind polymorphism. But perhaps my encoding doesn't have the features you'd wish? -- François Pottier Francois.Pottier@inria.fr http://pauillac.inria.fr/~fpottier/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners