From ec6f40d9f519f9e31ff6efbbb8cd7fed1871ca7e Mon Sep 17 00:00:00 2001 From: simonm <unknown> Date: Mon, 2 Feb 1998 13:31:19 +0000 Subject: [PATCH] [project @ 1998-02-02 13:31:19 by simonm] remove old section about module recursion. --- ghc/docs/users_guide/debugging.vsgml | 48 ---------------------------- 1 file changed, 48 deletions(-) diff --git a/ghc/docs/users_guide/debugging.vsgml b/ghc/docs/users_guide/debugging.vsgml index 8931dd662360..2a1548f22b5f 100644 --- a/ghc/docs/users_guide/debugging.vsgml +++ b/ghc/docs/users_guide/debugging.vsgml @@ -322,51 +322,3 @@ flags in your module, the OPTIONS will get put into the generated .hc file). %---------------------------------------------------------------------- -<sect2>How to compile mutually recursive modules -<p> -<nidx>module system, recursion</nidx> - -Currently, the compiler does not have proper support for dealing with -mutually recursive modules: - -<tscreen><verb> -module A where - -import B - -newtype A = A Int - -f :: B -> A -f (B x) = A x --------- -module B where - -import A - -data B = B !Int - -g :: A -> B -g (A x) = B x -</verb></tscreen> - -When compiling either module A and B, the compiler will try (in vain) -to look for the interface file of the other. So, to get mutually -recursive modules off the ground, you need to hand write an interface -file for A or B, so as to break the loop. For the example at hand, the -boot interface file for A would like the following: - -<tscreen><verb> -_interface_ A 1 -_exports_ -A A(A) f; -_declarations_ -1 newtype A = A PrelBase.Int ; -1 f _:_ B.B -> A.A ;; -</verb></tscreen> - -To make sure you get the syntax right, tailoring an existing interface -file is a Good Idea. - -<bf>Note:</bf> This is all a temporary solution, a version of the -compiler that handles mutually recursive properly without the manual -construction of interface file, is in the works. -- GitLab