X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fphases.sgml;h=e0f92b3fd23b408d63061bdb816631ddabf936dc;hb=d28ba8c800901bea01f70c4719278c2a364cf9fc;hp=0dee0c1f8fb6b59c99b084a96df1ee88e1a712a0;hpb=dd6fe03634149bfb79aa1878114514806161947b;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/phases.sgml b/ghc/docs/users_guide/phases.sgml index 0dee0c1..e0f92b3 100644 --- a/ghc/docs/users_guide/phases.sgml +++ b/ghc/docs/users_guide/phases.sgml @@ -555,6 +555,27 @@ strmod = "\ + + + specifying your own main function + + The normal rule in Haskell is that your program must supply a main + function in module Main. When testing, it is often convenient + to change which function is the "main" one, and the flag + allows you to do so. The thing can be one of: + + A lower-case identifier foo. GHC assumes that the main function is Main.foo. + An module name A. GHC assumes that the main function is A.main. + An qualified name A.foo. GHC assumes that the main function is A.foo. + + Strictly speaking, is not a link-phase flag at all; it has no effect on the link step. + The flag must be specified when compiling the module containing the specified main function (e.g. module A + in the latter two items above. It has no effect for other modules (and hence can safely be given to ghc --make). + + + + + linking Haskell libraries with foreign code @@ -564,7 +585,7 @@ strmod = "\ be supplying its definition of main() at link-time, you will have to. To signal that to the compiler when linking, use - . + . See also . Notice that since the command-line passed to the linker is rather involved, you probably want to use