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] Modules Order
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-18 (20:55)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] Modules Order
Warp wrote:

>The problem here is that we don't know if we're using either only types or
>functions from the other module.

One solution to that is to build interfaces containing types
with no corresponding implementation file. Then if you use
a name X for which there is an X.mli but no,
you're only using types.

This seems like a good policy in general, it is more robust,
since there is no need to keep a duplicated ml and mli file.

Ocaml's ability to process a .mli file with no corresponding
.ml file doesn't appear to be documented... it works for
the native code compiler, don't know about the bytecode

If a type is only used locally, the requirement can be relaxed:
in such cases, by specification, some functions must be used
too, so the type can be included in the .ml and mli files.

BTW: the big pain here is functors: using ocamlc -i
to generate an expanded interface for a fuctor application
is really horrible and rarely works properly (you have to edit
the output to replace expanded definitions with aliases
to have any hope of reading it).

Is there a better way?

John Max Skaller,
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.

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