NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.64 ">

12.2. 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.

  • 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)
      russel :: U -> Bool
      russel u@(MkU p) = not $ p u
      x :: Bool
      x = russel (MkU russel)
    We have never found another program, 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.