"Gabriel Scherer" <gabriel.sche...@gmail.com> wrote:
>> Now I want to design a module Q, with operations using type t. To refer to
>> t in
>> the signature of Q, I am obliged to declare a module Mt : MT inside the
>> signature
>>
>> module type QT = sig
>>  module Mt : MT
>>  val g : Mt.t -> ....
>> end
>
> I don't believe this is the way to go.

Actually, there is nothing wrong with coste's approach. In fact, that is the
way advocated by some in the ML modules community (see e.g. Part III on
modules in Bob Harper's SML book,
http://www.cs.cmu.edu/~rwh/smlbook/book.pdf). One advantage is that it makes
signatures more self-contained.

Others prefer the more "lightweight" approach of only putting in the types,
like you suggest. It works well, too, but can get more tedious when you are
dealing with modules exporting several types, or with several modules
exporting types of conflicting names.

/Andreas


-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to