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] Why not 'include' in an .mli file?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-14 (16:41)
From: Richard Jones <rich@a...>
Subject: [Caml-list] Why not 'include' in an .mli file?

I have a library which for various reasons is split into two modules,
called them Analysis_p and Analysis.

I want end-user programs to be able to 'open Analysis', and get all
the symbols from both modules.  This is simple enough using the
'include' directive:	include Analysis_p
		(* plus a few extra functions *)

However when I added an analysis.mli file, I found that I could not
automatically 'include' symbols from Analysis_p.  The following
doesn't work:

analysis.mli:	include Analysis_p
		(* plus a few extra prototypes *)

ocamlc -w s -g -I +pcre -I +postgres -I +dbi -c analysis.mli
File "analysis.mli", line 1, characters 8-24:
Unbound module type Analysis_p

Instead it seems, as far as I can see, that I have to list out all the
prototypes again in analysis.mli.  Is this so?  If so, it's a pain for
me, and means that prototypes for one function exist in two different
places (also I don't control Analysis_p directly, so it requires extra


Richard Jones.
Merjis Ltd. - improving website return on investment
MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,
RPMs, pkgs etc. Linux, BSD, Solaris.

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