English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlbuild and automatic dependencies
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-16 (14:40)
From: Jacques Garrigue <garrigue@m...>
Subject: Re: [Caml-list] ocamlbuild and automatic dependencies
From: Joel Reymont <joelr1@gmail.com>

> It appears that simply copying foo.mli into foo.ml should solve the  
> issue.
> I kind of hate having two identical files that I'll need to update.  
> Do I have to get used to it?
> 	Thanks, Joel

But... you don't need foo.mli.
So having only foo.ml should be enough.
I know this may feel a bit strange, but in this case the essential
part is foo.ml.
Note that this is partly due to the fact foo.mli does not define a
module type, it just wraps some type definitions done in foo.ml.

An amusing alternative is to define a module type in foo.mli.

module type T = sig
  type t1 = ...
  type t2 = ...

Now you can define a module containing the types of Foo.T without any

module rec FT : Foo.T = FT

Of course this only works if T contains only type definitions.


Jacques Garrigue