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
Re: type declaration in */mli & *.ml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-10-06 (07:09)
From: kahl@d...
Subject: Re: type declaration in */mli & *.ml
Hendrik Tews writes:
 > I am writing again about a topic we had on the list last year
 > (cf. and

 > As Xavier writes it is a pain that in some circumstances
 > (specifications of types and signatures) the same code has to be
 > written twice, first in the specification and then in the
 > implementation.

 > Is there any solution to this? 

 > Has anybody tried to include parts of an interface into an
 > implementation (for instance by means of a preprocessor)?

I am using FunnelWeb (a language-independent literate programming system)
for almost everything, and it is a nice solution to this problem, too.

For my current project, I edit a single FunnelWeb file (currently >800k)
in the folding-mode of Emacs, and a single run of FunnelWeb
(8 seconds on a SparcStation 20) produces a Makefile, 48 OLabl modules
with interfaces, among these 4 lexers and 4 parsers, several special
auxiliary files, and a LaTeX file containing 400+ pages of documented code.

The documented code in the literate programming style can be very nice
and useful, but even if you do not want to go literate,
FunnelWeb is still a very useful preprocessor
(I must admit that I am sometimes lazy on documentation, too...)

FunnelWeb is available via:

There is also a modified version (which I haven't tried yet)
that allows HTML output and line directives:

Happy weaving!