Hi,

is there some way to put extra module annotations on modules when each module is put in separate files. I want to have a private, friend an public interface to my modules (discussed previously in this thread:
http://www.mail-archive.com/caml-list@yquem.inria.fr/msg06513.html

If I put it in one file, it seems to work:
module type MP = (* Signature of public module *)
sig
  type t
  val make_t : int -> t
  val public : t -> int
end
 
module type MF = (* Signature of 'friend' module *)
sig
  include MP
  val friend : t -> int
end

module T = (* Type of t *)
struct
  type t = int
end

module MI = (* Implementation *)
struct
  type t = T.t
  let make_t a = a
  let priv a = a + a
  let friend a = a + a
  let public a = a + a
end


module MP : MP = MI (* Public module *)
module MF : (MF with type t = T.t) = MI (* Friend module *)


module type F = (* Signatur of friend *)
sig
  val f1 : int -> int
  val f2 : int -> int
end


module F : F =
struct
  module M = MF
  let f1 a = a + (M.public (M.make_t a))
  let f2 a = a + (M.friend a)
end



let _ = F.f1 3
let _ = F.f2 3
let _ = MP.public (MP.make_t 10)

But I can not figure out how to put the signatures on MP and MF modules when I put them in mP.ml and mF.ml. Do I need to put them inside nested structs inside the files?

Thanks,

Hans