From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 84227BB81 for ; Thu, 11 Nov 2004 10:48:52 +0100 (CET) Received: from interferon.mpi-sb.mpg.de (ag4.mpi-sb.mpg.de [139.19.1.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAB9mqnu020783 for ; Thu, 11 Nov 2004 10:48:52 +0100 Received: from amavis by interferon.mpi-sb.mpg.de with scanned-ok (Exim 3.36 #1 (Debian)) id 1CSBZT-00076B-00 for ; Thu, 11 Nov 2004 10:48:51 +0100 Received: from maildist ([139.19.90.238] helo=mpi-sb.mpg.de) by interferon.mpi-sb.mpg.de with esmtp (Exim 3.36 #1 (Debian)) id 1CSBZS-00075u-00 for ; Thu, 11 Nov 2004 10:48:50 +0100 Received: from mpiat2314 (Debian-exim@mpiat2314 [139.19.20.103]) by mpi-sb.mpg.de (8.12.9+Sun/8.12.9) with ESMTP id iAB9mnpA004809 for ; Thu, 11 Nov 2004 10:48:49 +0100 (MET) Received: from localhost.mpi-sb.mpg.de ([127.0.0.1] helo=mpiat2314 ident=prevosto) by mpiat2314 with smtp (Exim 4.34) id 1CSBZR-0008FW-Jb for caml-list@yquem.inria.fr; Thu, 11 Nov 2004 10:48:49 +0100 Date: Thu, 11 Nov 2004 10:48:49 +0100 From: Virgile Prevosto To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] module type... Message-ID: <20041111104849.29e7e506@mpiat2314> In-Reply-To: <20041111090931.GA13972@pulp.anu.edu.au> References: <20041111083547.GA13116@pulp.anu.edu.au> <1100163369.2579.70.camel@pelican.wigram> <20041111090931.GA13972@pulp.anu.edu.au> X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS perl-11 X-Miltered: at nez-perce with ID 41933584.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 functors:01 ocaml:01 htmlman:01 sig:01 val:01 val:01 ...:98 ...:98 tutto:98 oggi:98 volta:98 abstract:01 abstract:01 modules:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Hello, Le 11.11.2004, =E0 20:09:31, Pietro Abate a =E9crit: >=20 > below the extended version of the problem with the same error... >=20 > any advice on how to modify my modules/classes design to overcome this > problem ? what I'm trying to do is to have set, setofset, > setofsetofset etc using the same code base and functors... >=20 You can use a variant of the solution (a), with t still being abstract in ElType and the use of explicit type equalities (see the reference manual,, section 2.4) for each of the implementations: > module type ElType =3D > sig > type t (* type t is abstract here. *) > val copy : t -> t > val to_string : t -> string > end > module TermType : ElType=20 with type t =3D int=20 (* TermType.t is unifiable with int *) ...=20 > module SetOfTerm =3D MakeSet (TermType) (Set.Make);; >=20 > module SetOfTermType : ElType=20 with type t =3D SetOfTerm.set (* SetOfTermType.t is unifiable with Set.OfTerm.set *) ... --=20 E tutto per oggi, a la prossima volta Virgile