caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: skaller@users.sourceforge.net
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] My wishlist: DRY modules
Date: Thu, 14 Oct 2004 10:38:38 +0900 (JST)	[thread overview]
Message-ID: <20041014.103838.28784105.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <1097713265.2581.41.camel@pelican.wigram>

From: skaller <skaller@users.sourceforge.net>

> But can you do that with functor instances?
> 
> When I write something like:
> 
> module IntSet = Set.Make(struct type t = int end)
> 
> but type of IntSet is be spelled out long hand
> in the mli file. This is far worse than merely
> reflecting the interface of a module you wrote
> by hand -- it also breaks with upgrades to
> the library :(

In the interface, you just write:
  module IntSet : Set.S with elt = int

So you see that as long as you have the right signature defined
somewhere, your interfaces are going to be pretty short.

My main grudge is that an interface is not a signature, so you cannot
write things like:
  module MyList : List
while you can create an interface from a signature
  (* myList.mli *)
  include ListSig

Jacques Garrigue

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-10-14  3:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 22:00 Brian Hurt
2004-10-13 23:09 ` brogoff
2004-10-14  0:21   ` skaller
2004-10-14  1:38     ` Jacques Garrigue [this message]
2004-10-30  1:21 ` Tony Edgin

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=20041014.103838.28784105.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /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).