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 TAA31558 for caml-redistribution; Sat, 2 Oct 1999 19:49:50 +0200 (MET DST) 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 XAA08483 for ; Thu, 30 Sep 1999 23:19:36 +0200 (MET DST) Received: from berry.cs.brandeis.edu (berry.cs.brandeis.edu [129.64.2.5]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA24429 for ; Thu, 30 Sep 1999 23:19:28 +0200 (MET DST) Received: from lachesis.cs.brandeis.edu (lachesis.cs.brandeis.edu [129.64.3.222]) by berry.cs.brandeis.edu (8.9.1a/8.9.1a) with ESMTP id RAA00646 for ; Thu, 30 Sep 1999 17:19:26 -0400 (EDT) Received: (from bruncott@localhost) by lachesis.cs.brandeis.edu (8.8.7/8.8.7) id RAA20060; Thu, 30 Sep 1999 17:23:14 -0400 Date: Thu, 30 Sep 1999 17:23:14 -0400 Message-Id: <199909302123.RAA20060@lachesis.cs.brandeis.edu> From: Georges Brun-Cottan To: caml-list@inria.fr Subject: type contraints between module signatures MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Sender: weis Hi, I have two signatures A and B. I would like to constrain the signature B with a type defined in A. I cannot succeed. ** foo.ml ** module type A = sig type op_t type state type view type upcalls = { install_state : state -> unit; get_state : unit -> state;} val install : view -> unit end module type B = sig val install : A.upcalls -> unit end *** ocamlc -c foo.ml File "foo.ml", line 14, characters 16-25: Unbound type constructor A.upcalls I would like to constrain B.install to accept only A.upcalls parameters. What's wrong? Is this relates to the recent `Parameterized signatures needed ?' thread?. Thanks, -- Georges PS: Just to precise the point, here is the real example. The problem is with Replica_intf.protocol_upcalls in the Protocol_intf.install signature. module type Replica_intf = sig open Ensemble open View type op_t type state type metrics type view = View.full type acker = op_t -> unit type op_generator = unit -> (op_t * acker) option type protocol_upcalls = { install_state : state -> unit; get_state : unit -> state; getnewop : op_generator; } type handlers = { upcalls : protocol_upcalls ; heartbeat : Time.t -> unit; } val mu : op_t -> metrics val execute : op_t -> bool val install : view -> handlers val to_string : op_t -> string val dump : unit -> unit end open Replica_intf module type Protocol_intf = sig open Ensemble open Appl_intf open New open Trans open Util open Replica_intf type operation type metrics type upcalls type handlers = { deliver : origin -> cast_or_send -> operation -> (operation naction) list; fetch : unit -> (operation naction) list; dump : unit -> unit; stable : unit -> bool; } val install : View.full -> bool -> Replica_intf.protocol_upcalls -> int -> metrics -> (operation naction list) * handlers end