It’s rare to really need recursive modules, if you can share more code we could advice if they are worth the trouble…
Otherwise, it should be possible to break down the issue in two steps:
module A (B : sig type t end) = struct
type t = Wrap of B.t
module Make (Bfun : sig val to_a : B.t -> t end) : sig
val to_b : t -> B.t
end = struct
let to_b (Wrap b) = b
end
end
module A_int = A (struct type t = int end)
module A_fun = A_int.Make (struct let to_a b = A_int.Wrap b end)