caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien <Damien.Pous@ens-lyon.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] type issues with modules
Date: Tue, 11 Nov 2003 18:25:30 +0100	[thread overview]
Message-ID: <20031111182530.71a9a9c7.Damien.Pous@ens-lyon.fr> (raw)
In-Reply-To: <20031111172147M.garrigue@kurims.kyoto-u.ac.jp>

On Tue, 11 Nov 2003 17:21:47 +0900 Jacques Garrigue wrote:
> As specified in the reference manual, the combination of .ml and .mli
> is expected to mean:
>   module type Sig_mod1 = sig <mod1.mli> end
>   module Struct_mod1 = struct <mod1.ml> end
>   module Mod1 : Sig_mod1 = Struct_mod1

Let's be a bit fussy...
 
The manual says :
<<
	module Mod1: sig <mod1.mli> end = struct <mod1.ml> end
>>

Hopefully, because the first translation would export hidden parts of
Mod1 via Struct_mod1.

But I think that giving a name to the signature of Mod1 (Sig_mod1) could
be useful :

<<
	module type MOD1 : sig <mod1.mli> end
	module Mod1 : MOD1 = struct <mod1.ml> end
>>

Especially when hand-packing some modules : 
"ocamlc -pack" checks the packed cmo against an optional interface file,
but the latter is rather boring to write, since one has to copy&paste
the content of each packed interface.

If the module types were given a name, one could just write 
<<
	module Mod1: MOD1
	...
>>

damien

PS: I tried "module Mod1: Sig_mod1", of course it doesn't work :-(

-------------------
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:[~2003-11-11 17:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-11  5:33 Chris GauthierDickey
2003-11-11  8:21 ` Jacques Garrigue
2003-11-11 17:25   ` Damien [this message]
2003-11-12  1:12     ` Jacques Garrigue
2003-11-12 12:51       ` Remi Vanicat
2003-11-13 21:31       ` Issac Trotts

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=20031111182530.71a9a9c7.Damien.Pous@ens-lyon.fr \
    --to=damien.pous@ens-lyon.fr \
    --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).