X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=docs%2Fusers_guide%2Fusing.xml;h=df015213d88de845703dc8de223432abb0466e89;hp=7ef2f2f99409d11386795e6fd33516696f994e21;hb=b2524b3960999fffdb3767900f58825903f6560f;hpb=a7554688338b04ec362bc475b0992ef8799c8bd0 diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 7ef2f2f..df01521 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -783,18 +783,6 @@ ghc -c Foo.hs - - - - - Does a dry-run, i.e. GHC goes through all the motions - of compiling as normal, but does not actually run any - external commands. - - - - - @@ -990,9 +978,11 @@ ghc -c Foo.hs not enabled by are , + , , , - , and + , + , . @@ -1175,6 +1165,21 @@ foreign import "&f" f :: FunPtr t + : + + + Causes the compiler to emit a warning when a Prelude numeric + conversion converts a type T to the same type T; such calls + are probably no-ops and can be omitted. The functions checked for + are: toInteger, + toRational, + fromIntegral, + and realToFrac. + + + + + : @@ -1200,26 +1205,41 @@ foreign import "&f" f :: FunPtr t - : + , + : + + incomplete patterns, warning patterns, incomplete - Similarly for incomplete patterns, the function + The option warns + about places where + a pattern-match might fail at runtime. + The function g below will fail when applied to non-empty lists, so the compiler will emit a warning about this when is - enabled. - + enabled. g [] = 2 - - This option isn't enabled by default because it can be + This option isn't enabled by default because it can be a bit noisy, and it doesn't always indicate a bug in the program. However, it's generally considered good practice - to cover all the cases in your functions. + to cover all the cases in your functions, and it is switched + on by . + + The flag is + similar, except that it + applies only to lambda-expressions and pattern bindings, constructs + that only allow a single pattern: + +h = \[] -> 2 +Just k = f y + + @@ -1268,6 +1288,39 @@ f foo = foo { x = 6 } + + : + + missing import lists, warning + import lists, missing + + + + This flag warns if you use an unqualified + import declaration + that does not explicitly list the entities brought into scope. For + example + + +module M where + import X( f ) + import Y + import qualified Z + p x = f x x + + + The flag will warn about the import + of Y but not X + If module Y is later changed to export (say) f, + then the reference to f in M will become + ambiguous. No warning is produced for the import of Z + because extending Z's exports would be unlikely to produce + ambiguity in M. + + + + + : @@ -1308,6 +1361,20 @@ f foo = foo { x = 6 } + : + + + type signatures, missing + + If you use the + flag GHC will warn + you about any polymorphic local bindings. As part of + the warning GHC also reports the inferred type. The + option is off by default. + + + + : @@ -1398,6 +1465,7 @@ f "2" = 2 e.g., the ‘default default’ for Haskell 1.4 caused the otherwise unconstrained value 1 to be given the type Int, whereas Haskell 98 + and later defaults it to Integer. This may lead to differences in performance and behaviour, hence the usefulness of being non-silent about this. @@ -1630,37 +1698,12 @@ f "2" = 2 . - - - - : - -Ofile <file> option - optimising, customised - - - (NOTE: not supported since GHC 4.x. Please ask if - you're interested in this.) - - For those who need absolute - control over exactly what options are - used (e.g., compiler writers, sometimes :-), a list of - options can be put in a file and then slurped in with - . - - In that file, comments are of the - #-to-end-of-line variety; blank - lines and most whitespace is ignored. - - Please ask if you are baffled and would like an - example of ! - - We don't use a flag for day-to-day work. We use to get respectable speed; e.g., when we want to measure something. When we want to go for - broke, we tend to use (and we go for + broke, we tend to use (and we go for lots of coffee breaks). The easiest way to see what (etc.) @@ -2104,25 +2147,6 @@ f "2" = 2 - - - RTS - option - - Migrate a thread to the current CPU when it is woken - up. Normally when a thread is woken up after being - blocked it will be scheduled on the CPU it was running on - last; this option allows the thread to immediately migrate - to the CPU that unblocked it. - - The rationale for allowing this eager migration is - that it tends to move threads that are communicating with - each other onto the same CPU; however there are - pathalogical situations where it turns out to be a poor - strategy. Depending on the communication pattern in your - program, it may or may not be a good idea. - - @@ -2181,27 +2205,6 @@ f "2" = 2 - - : - - (x86 only)-monly-N-regs - option (iX86 only) GHC tries to - “steal” four registers from GCC, for performance - reasons; it almost always works. However, when GCC is - compiling some modules with four stolen registers, it will - crash, probably saying: - - -Foo.hc:533: fixed or forbidden register was spilled. -This may be due to a compiler bug or to impossible asm -statements or clauses. - - - Just give some registers back with - . Try `3' first, then `2'. - If `2' doesn't work, please report the bug to us. - - @@ -2218,9 +2221,8 @@ statements or clauses. .hcr. The Core format is described in An External Representation for the GHC Core Language, and sample tools - for manipulating Core files (in Haskell) are in the GHC source distribution - directory under utils/ext-core. - Note that the format of .hcr + for manipulating Core files (in Haskell) are available in the + extcore package on Hackage. Note that the format of .hcr files is different from the Core output format that GHC generates for debugging purposes (), though the two formats appear somewhat similar.