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] Newbie: Separate compilation of interfaces, modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: andrew cooke <andrew@a...>
Subject: [Caml-list] Newbie: Separate compilation of interfaces, modules


I can't work out how to structure the following in files (there are
examples in the documentation, but all seem to be for interactive work). 
I don't know if the problem is conceptual (not understanding modules,
signatures etc) or practical (don't know what to type).

I have an interface, PersistentArray, that I define in PersistentArray.mli

Then I have an implementation, BinaryTreeArray, that I code in

But where do I put the information that BinaryTreeArray implements
PersistentArray?  What should go in BinaryTreeArray.mli so that I can use
it as a particular implementation of PersistentArray?

The idea is that later I can define some other implementation, say
TrieArray, that can be used as the PersistentArray implementation without
changing any more code than is necessary (preferably just one line


  __ _ __ ___  ___| |_____   work web site:
 / _` / _/ _ \/ _ \ / / -_)  personal web site:
 \__,_\__\___/\___/_\_\___|  personal gallery:

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