Browse thread
[Caml-list] Newbie: Separate compilation of interfaces, modules
-
andrew cooke
- Jean-Christophe Filliatre
- andrew cooke
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2004-02-28 (13:04) |
From: | andrew cooke <andrew@a...> |
Subject: | To beginners list Re: [Caml-list] Newbie: Separate compilation of interfaces, modules |
Ah, sorry - I've just seen the pointer to the beginners list. Will repost this question there (but not the one on polymorphic variants). Cheers, Andrew andrew cooke said: > > Hi, > > 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 > BinaryTree.ml > > 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 > somewhere). > > Thanks, > Andrew > > -- > __ _ __ ___ ___| |_____ work web site: > http://www.ctio.noao.edu/~andrew > / _` / _/ _ \/ _ \ / / -_) personal web site: > http://www.acooke.org/andrew > \__,_\__\___/\___/_\_\___| personal gallery: > http://www.acooke.org/pancito > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: > http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: > http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > -- __ _ __ ___ ___| |_____ work web site: http://www.ctio.noao.edu/~andrew / _` / _/ _ \/ _ \ / / -_) personal web site: http://www.acooke.org/andrew \__,_\__\___/\___/_\_\___| personal gallery: http://www.acooke.org/pancito ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners