caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Yet another question about the module system
@ 1996-10-18  8:41 Jocelyn Serot
  1996-10-21 14:19 ` Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Jocelyn Serot @ 1996-10-18  8:41 UTC (permalink / raw)
  To: caml-list


Hello,

In a previous post i was asking a few questions about the relations between 
the module system and separate compilation. Thanks to the clever answers of
a few people, i thought i have understood the whole stuff. Until i encounter
the following pb:

Suppose i have 2 files:

A first one, specifying an interface for an abstract type Bar:

****** bar.mli **********
type t
val x :t
*************************

A second one, specifying a second abstract type built upon the first one
using functor application

****** foo.mli **********
module type FOO = sig type t val y : t end
module Make(B:Bar) : (FOO with type t = Bar.t)
*************************

Trying to compile this separately:

	> ocamlc -c bar.mli
	> ocamlc -c foo.mli

produces the following error message:
	> File "foo.mli", line 3, characters 14-17: Unbound module type Bar

BUT, if write foo.mli like that

****** foo.mli **********
module type FOO = sig type t val y : t end
val y : Bar.t
*************************

Everythings compiles ok.
So, it seems that the Bar interface is known when compiling Foo (i guess this
goes trough the bar.cmi file).
Why cannot it be used as a functor argument then ?

	Jocelyn Serot

Es-mail: jserot@epcc.ed.ac.uk  (->Nov 29/96) ...............................
S-mail: LASMEA - URA 1793 CNRS, Universite Blaise Pascal, 63177 Aubiere cedex
Tel: (33) 73.40.73.30 - Fax: (33) 73.40.72.62 ...............................
.... http://wwwlasmea.univ-bpclermont.fr/Personnel/Jocelyn.Serot/Welcome.html





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-10-22 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-18  8:41 Yet another question about the module system Jocelyn Serot
1996-10-21 14:19 ` Xavier Leroy
1996-10-21 14:44   ` Jocelyn Serot

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).