I'm playing with specifying interfaces for packed modules. Afaik, when compiling library lib, if there is a file lib.mli, compiler will check whether library obeys the interface in lib.cmi and then use that as the interface for the library, otherwise the interface will be inferred. This is what I have. foo.ml: type t = int let x = 5 foo.mli: type t val x : t g.mli: module Foo : sig include module type of Foo end and I compile the library G like this: ocamlopt.opt -for-pack G -c foo.mli foo.ml ocamlopt.opt -c g.mli ocamlopt.opt -pack -o g.cmx foo.cmx No problems, everything works. Now I want to get fancy and I add std.ml, and change g.mli (code included as packed.tar.gz) std.ml: module Foo = Foo g.mli: module Std : sig include module type of Std end and compile similarly like before ocamlopt.opt -for-pack G -c foo.mli foo.ml ocamlopt.opt -for-pack G -c foo.cmx std.ml ocamlopt.opt -c g.mli ocamlopt.opt -pack -o g.cmx foo.cmx std.cmx But now I get this helpful error message File "g.cmx", line 1, characters 0-1: Error: The implementation (obtained by packing) does not match the interface g.mli: Modules do not match: sig module Foo : sig type t = Foo.t val x : t end end is not included in sig module Foo : sig type t = Foo.t val x : t end end Modules do not match: sig type t = Foo.t val x : t end is not included in sig type t = Foo.t val x : t end Type declarations do not match: type t = Foo.t is not included in type t = Foo.t Does anyone know what is going on here? Thanks, Milan