Define recursive signatures for modules
I know that it is possible to define recursive modules, does anyone know how to define recursive signatures? For instance, I would like to realize: module type AAA = sig module Bbb : BBB type 'a t val f : 'a Bbb.t -> 'a t end module type BBB = sig module Aaa : AAA type 'a t val g : 'a Aaa.t -> 'a t end Could anyone help? You can't, as far as I can tell. The closest solution is to limit the "recursive" bits to what is actually needed to express each signature separately: module type AA = sig module B : sig type t end type t val f : unit -> B.t end module type BB = sig module A : sig type t end