X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fbugs.sgml;h=0d5fa2b7243e52a2ac2c5a5dcef2350e0296f9e1;hb=7a49c2ef4297f6314ebb2d64de3dc8332150c153;hp=834e630d9e2f78655db93e51ef25d468302309b1;hpb=79f0c44238069363ece749a049727051cd6a89b3;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/bugs.sgml b/ghc/docs/users_guide/bugs.sgml index 834e630..0d5fa2b 100644 --- a/ghc/docs/users_guide/bugs.sgml +++ b/ghc/docs/users_guide/bugs.sgml @@ -1,13 +1,12 @@ - Known bugs and infelicities - + Known bugs and infelicities - - Haskell 98 vs. Glasgow Haskell: language non-compliance + <sect1 id="vs-Haskell-defn"> + <title>Haskell 98 vs. Glasgow Haskell: language non-compliance - - GHC vs the Haskell 98 language - Haskell 98 language vs GHC + + GHC vs the Haskell 98 language + Haskell 98 language vs GHC This section lists Glasgow Haskell infelicities in its implementation of Haskell 98. See also the “when things @@ -40,16 +39,6 @@ single qualified operator rather than the two lexemes M and .\. - - - When is on, GHC - reserves several keywords beginning with two underscores. - This is due to the fact that GHC uses the same lexical - analyser for interface file parsing as it does for source - file parsing, and these keywords are used in interface - files. Do not use any identifiers beginning with a double - underscore in mode. - @@ -86,21 +75,7 @@ Expressions and patterns - - - Very long String constants: - - May not go through. If you add a “string - gap” every few thousand characters, then the strings - can be as long as you like. - - Bear in mind that string gaps and the - - option don't mix very well (see - ). - - - + None known. @@ -110,23 +85,31 @@ None known. - - - Module system and interface files - - - - - Namespace pollution - - Several modules internal to GHC are visible in the - standard namespace. All of these modules begin with - Prel, so the rule is: don't use any - modules beginning with Prel in your - program, or you may be comprehensively screwed. - - - + + + Module system and interface files + + + + Main module + + GHC interprets the module header +module Main where + as if it was +module Main (main) where + + + This change allows GHC to optimise slightly more + aggresively inside the Main + module. + + You are highly unlikely to notice the difference, since + importing Main is very rare (it would + introduce a recursive module dependency, so doing it by + accident is unlikely too). + + + @@ -151,7 +134,7 @@ main = print (array (1,1) [(1,2), (1,3)]) - In Prelude support + In <literal>Prelude</literal> support @@ -170,12 +153,12 @@ main = print (array (1,1) [(1,2), (1,3)]) Arbitrary-sized tuples - Tuples are currently limited to size 61. HOWEVER: + Tuples are currently limited to size 100. HOWEVER: standard instances for tuples (Eq, Ord, Bounded, Ix Read, and Show) are available - only up to 5-tuples. + only up to 16-tuples. This limitation is easily subvertible, so please ask if you get stuck on it. @@ -279,67 +262,73 @@ main = print (array (1,1) [(1,2), (1,3)]) - - - - - - - Known bugs or infelicities - -GHC has the following known bugs or infelicities: - - - -GHC only provides tuples up to size 62, and derived tuple instances (for -Eq, Ord, etc) up to size 15. - - - -GHC can warn about non-exhaustive or overlapping patterns, and usually does so correctly. -But not always. It gets confused by string patterns, and by guards, and can then -emit bogus warnings. The entire overlap-check code needs an overhaul really. - - - - -Dangers with multiple Main modules. - - - GHC does not insist that module Main lives in a file called Main.hs. - This is useful if you want multiple versions of Main. But there's a danger: when - compiling module Main (regardless of what file it comes from), GHC looks for - the interface Main.hi; it uses this to get version information from the last - time it recompiled Main. The trouble is that this Main.hi - may not correspond to the source file being compiled. - - - Solution: remove Main.hi first. A better solution would be for GHC to - record the source-file filename in the interface file, or even an MD5 checksum. - - + + + + + + Known bugs or infelicities + + In addition to the divergences from the Haskell 98 standard + listed above, GHC has the following known bugs or + infelicities. + + + + GHC can warn about non-exhaustive or overlapping + patterns (see , and usually + does so correctly. But not always. It gets confused by + string patterns, and by guards, and can then emit bogus + warnings. The entire overlap-check code needs an overhaul + really. + + + + Dangers with multiple Main + modules. + + GHC does not insist that module Main + lives in a file called Main.hs. This is + useful if you want multiple versions of + Main. But there's a danger: when compiling + module Main (regardless of what file it + comes from), GHC looks for the interface + Main.hi; it uses this to get version + information from the last time it recompiled + Main. The trouble is that this + Main.hi may not correspond to the source + file being compiled. + + Solution: remove Main.hi first. A + better solution would be for GHC to record the source-file + filename in the interface file, or even an MD5 checksum. + + - - -GHCi does not respect the default declaration in the module whose -scope you are in. Instead, for expressions typed at the command line, you always -get the default default-type behaviour; that is, default(Int,Double). - - -It would be better for GHCi to record what the default settings in each module are, and -use those of the 'current' module (whatever that is). - - - -GHCi does not keep careful track of what instance declarations are 'in scope' if they -come from other packages. -Instead, all instance declarations that GHC has seen in other packages are all in scope -everywhere, whether or not the module from that package is used by the command-line expression. - - - -GHC's inliner can be persuaded into non-termination using the standard way to encode -recursion via a data type: + + GHCi does not respect the default + declaration in the module whose scope you are in. Instead, + for expressions typed at the command line, you always get the + default default-type behaviour; that is, + default(Int,Double). + + It would be better for GHCi to record what the default + settings in each module are, and use those of the 'current' + module (whatever that is). + + + + GHCi does not keep careful track of what instance + declarations are 'in scope' if they come from other packages. + Instead, all instance declarations that GHC has seen in other + packages are all in scope everywhere, whether or not the + module from that package is used by the command-line + expression. + + + + GHC's inliner can be persuaded into non-termination + using the standard way to encode recursion via a data type: data U = MkU (U -> Bool) @@ -349,17 +338,19 @@ recursion via a data type: x :: Bool x = russel (MkU russel) -We have never found another class of programs, other than this contrived one, that makes GHC -diverge, and fixing the problem would impose an extra overhead on every compilation. So the -bug remains un-fixed. There is more background in - -Secrets of the GHC inliner. - - - - - + + We have never found another class of programs, other + than this contrived one, that makes GHC diverge, and fixing + the problem would impose an extra overhead on every + compilation. So the bug remains un-fixed. There is more + background in + Secrets of the GHC inliner. + + + + +