caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: rossberg@mpi-sws.org
To: "Gabriel Scherer" <gabriel.scherer@gmail.com>
Cc: coste@irit.fr, caml-list@inria.fr
Subject: Re: [Caml-list] reuse of abstract types
Date: Tue, 8 May 2012 11:53:24 +0200	[thread overview]
Message-ID: <c445ada0af36ba81e61256b99f0acff0.squirrel@mail.mpi-sws.org> (raw)
In-Reply-To: <CAPFanBFpOJrPYj8ja5WpqjbkG56BFQ_v4TAyta9gbjZs7jeA5Q@mail.gmail.com>

"Gabriel Scherer" <gabriel.scherer@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


      reply	other threads:[~2012-05-08  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 18:15 coste
2012-05-07 20:37 ` Gabriel Scherer
2012-05-08  9:53   ` rossberg [this message]

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=c445ada0af36ba81e61256b99f0acff0.squirrel@mail.mpi-sws.org \
    --to=rossberg@mpi-sws.org \
    --cc=caml-list@inria.fr \
    --cc=coste@irit.fr \
    --cc=gabriel.scherer@gmail.com \
    /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).