Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 = ...
  ...
end

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

module rec FT : Foo.T = FT

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

Cheers,

Jacques Garrigue