Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
mutually recursive modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-03-24 (09:21)
From: rossberg@p...
Subject: Re: [Caml-list] mutually recursive modules
"ketti" <> wrote:
> You have to factor out the types of the modules.
> Lets say we have modules A and B which are mutually recursive.
> A needs to know the signature of B and vise verse.
> So we define the signatures somewhere visible to both A and B:
> module type A_T = sig ... end
> module type B_T = sig ... end

Note that this only works if the signatures themselves aren't mutually
recursive - which often is the case. Unfortunately, there is no solution
that works in the general case.

- Andreas