Re: functors in batch compilation

From: Francois Rouaix (Francois.Rouaix@inria.fr)
Date: Wed May 07 1997 - 11:18:36 MET DST


Message-Id: <199705070918.LAA09046@madiran.inria.fr>
From: Francois Rouaix <Francois.Rouaix@inria.fr>
To: Lyn A Headley <laheadle@midway.uchicago.edu>
Subject: Re: functors in batch compilation
Date: Wed, 07 May 1997 11:18:36 +0200

> but does this mean one is forced to declare a functorized struct
> in a signature as well as in the implementation file?

You are never forced to write .mli files, but it's good practice, both
for documentation purposes and for better separate compilation performance.

> 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.
When defining functors, there are usually two components in the implementation
file. One is the "module type" for the functor argument, the other is
the functor itself.

> 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.
Have you checked the library ? Several modules contain functors (e.g. Set
or Map).

--f



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