From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA17517 for caml-redistribution; Tue, 17 Dec 1996 17:27:18 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA14099 for ; Tue, 17 Dec 1996 13:07:28 +0100 (MET) Received: from elrond.uc3m.es (elrond.uc3m.es [163.117.136.62]) by nez-perce.inria.fr (8.7.6/8.7.1) with SMTP id NAA18420 for ; Tue, 17 Dec 1996 13:04:20 +0100 (MET) Received: from imladris.uc3m.es (pc-13C07.uc3m.es) by elrond.uc3m.es (4.1/SM941027.01) id AA23703; Tue, 17 Dec 96 12:54:29 +0100 Message-Id: <32B7095A.99A@ing.uc3m.es> Date: Tue, 17 Dec 1996 12:58:02 -0800 From: "Francisco J. Valverde Albacete" Organization: Universidad Carlos III de Madrid X-Mailer: Mozilla 2.02 (Win95; I; 16bit) Mime-Version: 1.0 To: caml-list@inria.fr Subject: Piece composition of signatures (& problems derived from them too!) X-Url: http://pauillac.inria.fr/bin/msearch/caml/caml-list Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: weis Salut, *Caml* List, (* version francaise affreuse a` la fin *) I have been working on deriving a hierarchy of module signatures and modules (not classes!) for the benefit of the community (and mine I expect). Trying to mimic this description as undertaken by specification formalisms I have been trying to build signatures by piecewise composition (believe me, this might have some interest): (* defining a partial order *) module type ORDER = sig type t val (<=) : t -> t -> bool end;; (* defining a total order *) # module type TOTAL = sig type t val compare : t -> t -> int end;; module type TOTAL = sig type t val compare : t -> t -> int end # module type MIXED = sig include ORDER include TOTAL with type t = t (* THIS IS THE PROBLEM *) end;; module type MIXED = sig type t val <= : t -> t -> bool type t = t val compare : t -> t -> int end #module IntegerMixed : MIXED = struct type t = int let (<=) = (<=) let compare = (-) end;; Characters 31-91: Signature mismatch: Modules do not match: sig type t = int val <= : 'a -> 'a -> bool val compare : int -> int -> int end is not included in MIXED Type declarations do not match: type t = int is not included in type t = t The problem seems to be that the second "t" hides the first or the type equation t = int vanishes. Has anybody tried and do something remotely resembling this? Any remarks/suggestions? -------------------------------------------------------- J'essaye de composer des signatures des modules (les classes ne son point question ici) morceaux par morceaux, jusque comme on fait avec les langages d'especification formelle. svp, voyez les exemples en haut. Le proble`me me semble etre que le deuxie`me "t" cache le premier ou bien que l'equation de type t = int disparait. Est-ce qu'il y a quelqu'un que ait essaye de faire quelque chose semblable? Commentaires/alternatifs? -- Francisco J. Valverde Albacete Ayudante de Universidad Area de Tecnolog'ia Electr'onica Dpto. de Ingenier'ia Universidad Carlos III de Madrid e-mail: fva@ing.uc3m.es tel: 624 94 29 fax : 624 94 30