Modules can be recursive as well, but then you need to give them explicit module type definitions:
module Foo = {
module rec A: {
type t = {b: B.t}
} = {
type t = {b: B.t}
}
and B: {
type t = {a: A.t}
} = {
type t = {a: A.t}
}
}