English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

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" <kattlachan@gmail.com> 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