From: Georges Brun-Cottan <bruncott@cs.brandeis.edu>
To: caml-list@inria.fr
Subject: type contraints between module signatures
Date: Thu, 30 Sep 1999 17:23:14 -0400 [thread overview]
Message-ID: <199909302123.RAA20060@lachesis.cs.brandeis.edu> (raw)
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
***
<lachesis>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
reply other threads:[~1999-10-02 17:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199909302123.RAA20060@lachesis.cs.brandeis.edu \
--to=bruncott@cs.brandeis.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).