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:53)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Why not 'include' in an .mli file?
On Wed, 14 Apr 2004, Richard Jones wrote:
> 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

Note that this is a module type, not a module.  You could put the
module type (interface) of "Analysis_p" into the submodule "S" of the
extra-file "analysis_p_intf.mli". Use it then to restrict the interface
of "Analysis_p" in "analysis_p.mli", and include it in "analysis.mli"
using "include Analysis_p_intf.S".


Markus Mottl

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