I know that we can define two types linking each other, for instance:
type a =
| CC of b
and b =
| CD of a
Does anyone know how to do same thing for two modules?
module A = struct
type t = | CC of B.t
end
?and? B = struct
type t = | CD of A.t
end
It’s called recursive modules in OCaml. It’s a little bit unfortunate that you have to write type declaration twice.