X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fdebugging.vsgml;h=23cd5ca0370ee13aa7b92213848312cab9eb509d;hb=c8fce555ec943e88c3da871ddc8f63038ea239c7;hp=8931dd662360d99d65218c83085b87b8868129e3;hpb=abdd55c9c4a2873c2f4b25b4ea54ca921bca4f5e;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/debugging.vsgml b/ghc/docs/users_guide/debugging.vsgml index 8931dd6..23cd5ca 100644 --- a/ghc/docs/users_guide/debugging.vsgml +++ b/ghc/docs/users_guide/debugging.vsgml @@ -84,9 +84,24 @@ example: @ghc -noC -ddump-simpl Foo.hs@ @-hi@: -hi option -Do generate an interface file. This would normally be used in -conjunction with @-noC@, which turns off interface generation; -thus: @-noC -hi@. +Do generate an interface file (on @stdout@.) This would +normally be used in conjunction with @-noC@, which turns off interface +generation; thus: @-noC -hi@. + +@-hi-with-<section>@: +-hi-with option +Generate just the specified section of an interface file. In case you're +only interested in a subset of what @-hi@ outputs, @-hi-with-<section>@ +is just the ticket. For instance + + +-noC -hi-with-declarations -hi-with-exports + + +will output the sections containing the exports and the +declarations. Legal sections are: @declarations@, @exports@, +@instances@, @instance_modules@, @usages@, @fixities@, and +@interface@. @-dshow-passes@: -dshow-passes option @@ -322,51 +337,3 @@ flags in your module, the OPTIONS will get put into the generated .hc file). %---------------------------------------------------------------------- -How to compile mutually recursive modules -

-module system, recursion - -Currently, the compiler does not have proper support for dealing with -mutually recursive modules: - - -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 - - -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: - - -_interface_ A 1 -_exports_ -A A(A) f; -_declarations_ -1 newtype A = A PrelBase.Int ; -1 f _:_ B.B -> A.A ;; - - -To make sure you get the syntax right, tailoring an existing interface -file is a Good Idea. - -Note: 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.