From 6c7f9119c0d0e48b789a10b50e6ed0d1d50959b5 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Mon, 30 May 2011 09:23:28 +0200 Subject: [PATCH] separate_compilation.xml whitespace --- docs/users_guide/separate_compilation.xml | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/users_guide/separate_compilation.xml b/docs/users_guide/separate_compilation.xml index 099a91f..e2c9c33 100644 --- a/docs/users_guide/separate_compilation.xml +++ b/docs/users_guide/separate_compilation.xml @@ -114,9 +114,9 @@ has been specified, then the object filename is dir/mod.osuf, where mod is the module name with - dots replaced by slashes. GHC will silently create the necessary directory + dots replaced by slashes. GHC will silently create the necessary directory structure underneath dir, if it does not - already exist. + already exist. @@ -273,7 +273,7 @@ If you use ghc --make and you don't use the , the name GHC will choose for the executable will be based on the name of the file - containing the module Main. + containing the module Main. Note that with GHC the Main module doesn't have to be put in file Main.hs. Thus both @@ -433,7 +433,7 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `uname -m` - + Keeping Intermediate Files intermediate files, saving @@ -693,22 +693,22 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `uname -m` This section explains how. Every cycle in the module import graph must be broken by a hs-boot file. - Suppose that modules A.hs and B.hs are Haskell source files, + Suppose that modules A.hs and B.hs are Haskell source files, thus: module A where import B( TB(..) ) - + newtype TA = MkTA Int - + f :: TB -> TA f (MkTB x) = MkTA x module B where import {-# SOURCE #-} A( TA(..) ) - + data TB = MkTB !Int - + g :: TA -> TB g (MkTA x) = MkTB x @@ -750,12 +750,12 @@ module A where ghc -c A.hs-boot -When a hs-boot file A.hs-boot +When a hs-boot file A.hs-boot is compiled, it is checked for scope and type errors. When its parent module A.hs is compiled, the two are compared, and an error is reported if the two are inconsistent. - + Just as compiling A.hs produces an interface file A.hi, and an object file @@ -793,7 +793,7 @@ When a hs-boot file A.hs-boot ghc -M will report an error if a cycle is found. - A module M that is + A module M that is {-# SOURCE #-}-imported in a program will usually also be ordinarily imported elsewhere. If not, ghc --make automatically adds M to the set of modules it tries to @@ -812,9 +812,9 @@ A hs-boot file need only contain the bare A hs-boot file is written in a subset of Haskell: The module header (including the export list), and import statements, are exactly as in -Haskell, and so are the scoping rules. +Haskell, and so are the scoping rules. Hence, to mention a non-Prelude type or class, you must import it. - + There must be no value declarations, but there can be type signatures for values. For example: @@ -823,7 +823,7 @@ values. For example: Fixity declarations are exactly as in Haskell. Type synonym declarations are exactly as in Haskell. - A data type declaration can either be given in full, exactly as in Haskell, or it + A data type declaration can either be given in full, exactly as in Haskell, or it can be given abstractly, by omitting the '=' sign and everything that follows. For example: data T a b @@ -835,7 +835,7 @@ can be given abstractly, by omitting the '=' sign and everything that follows. You can also write out the constructors but, if you do so, you must write it out precisely as in its real definition. - If you do not write out the constructors, you may need to give a kind + If you do not write out the constructors, you may need to give a kind annotation (), to tell GHC the kind of the type variable, if it is not "*". (In source files, this is worked out from the way the type variable is used in the constructors.) For example: @@ -938,7 +938,7 @@ Foo.o Foo.hc Foo.s : Baz.hi # Foo imports Baz brought up to date. To bring it up to date, make looks for a rule to do so; one of the preceding suffix rules does the job nicely. These dependencies - can be generated automatically by ghc; see + can be generated automatically by ghc; see @@ -967,7 +967,7 @@ depend : Makefile. In general, ghc -M Foo does the following. - For each module M in the set + For each module M in the set Foo plus all its imports (transitively), it adds to the Makefile: @@ -990,7 +990,7 @@ M.o : X.hi-boot (See for details of hi-boot style interface files.) - + If M imports multiple modules, then there will be multiple lines with M.o as the target. @@ -1127,7 +1127,7 @@ just in case they contain an instance declaration that matters to M. This would be a disaster in practice, so GHC tries to be clever. In particular, if an instance declaration is in the same module as the definition -of any type or class mentioned in the head of the instance declaration +of any type or class mentioned in the head of the instance declaration (the part after the “=>”; see ), then GHC has to visit that interface file anyway. Example: @@ -1178,8 +1178,8 @@ These considerations lead to the following definition of an orphan module: least one orphan rule. An instance declaration in a module M is an orphan instance if - orphan instance - + orphan instance + The class of the instance declaration is not declared in M, and @@ -1191,7 +1191,7 @@ These considerations lead to the following definition of an orphan module: - Only the instance head + Only the instance head counts. In the example above, it is not good enough for C's declaration to be in module A; it must be the declaration of D or T. @@ -1205,9 +1205,9 @@ These considerations lead to the following definition of an orphan module: -If you use the flag , GHC will warn you +If you use the flag , GHC will warn you if you are creating an orphan module. -Like any warning, you can switch the warning off with , +Like any warning, you can switch the warning off with , and will make the compilation fail if the warning is issued. -- 1.7.10.4