Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] type issues with modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien <Damien.Pous@e...>
Subject: Re: [Caml-list] type issues with modules
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 <> end
>   module Mod1 : Sig_mod1 = Struct_mod1

Let's be a bit fussy...
The manual says :
	module Mod1: sig <mod1.mli> end = struct <> 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 <> 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


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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: