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 KAA16787; Mon, 28 May 2001 10:04:24 +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 KAA16752 for ; Mon, 28 May 2001 10:04:23 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4S83rj17581; Mon, 28 May 2001 10:03:53 +0200 (MET DST) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA16839; Mon, 28 May 2001 10:03:53 +0200 (MET DST) Date: Mon, 28 May 2001 10:03:53 +0200 From: Francois Pottier To: Tyng-Ruey Chuang Cc: caml-list@inria.fr Subject: Re: [Caml-list] weak type variables in module type declarations Message-ID: <20010528100353.A16789@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <200105231324.f4NDOgc28482@mail.iis.sinica.edu.tw> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <200105231324.f4NDOgc28482@mail.iis.sinica.edu.tw>; from trc@iis.sinica.edu.tw on Wed, May 23, 2001 at 09:24:42PM +0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dear Tyng-Ruey, Weak type variables are not allowed to appear in declared signatures, because there would be no good way of defining their meaning. Instead of > module type SUM = > sig > type ('a, 'b) t = Pink of 'a | Blue of 'b > > val pair : ('_a -> ('_a, '_b) t) * ('_a -> ('_a, '_b) t) > end how about trying module type SUM = sig type a type b type t = Pink of a | Blue of b val pair: (a -> t) * (a -> t) end Then, you can use, say, SUM with type a = int and type b = bool in a context where you know that a and b should be instantiated to int and bool, respectively. -- 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