2012-01-19 78 views

回答

4

它在OCaml中被稱爲recursive modules。有一點不幸,你必須寫兩次類型聲明。

module rec A: sig 
    type t = | CC of B.t 
end = 
struct 
    type t = | CC of B.t 
end 

and B: sig 
    type t = | CD of A.t 
end = 
struct 
    type t = | CD of A.t 
end