functors in batch compilation

From: Lyn A Headley (
Date: Tue May 06 1997 - 01:51:26 MET DST

Message-Id: <>
Subject: functors in batch compilation
Date: Mon, 05 May 1997 18:51:26 -0500
From: Lyn A Headley <>


While I think the Ocaml manual gives a good general tutorial on the
subject of the Module system, I am still confused about the _details_
of functorizing a module in a file.

The docs provide this hint:

Notice that only top-level structures can be mapped to
separately-compiled files, but not functors nor module types. However,
all module-class objects can appear as components of a structure, so
the solution is to put the functor or module type inside a structure,
which can then be mapped to a file.

but does this mean one is forced to declare a functorized struct
in a signature as well as in the implementation file? It would
seem to make more sense for the compiler to realize that it was
dealing with an implementation of a single module described in the
implementation file and just allow the signature to describe the
values of the (functorized) module that it wants to export. This
would avoid needing two names per module, one for the file and another
for the module.

I realize I might not be making sense but basically I don't understand
how to compile a functorized module into a file, and I wanted to prove
that I at least thought about it, thereby lessening the impression
that I am a punk kid who don't know nothin.


This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:10 MET