|The Glasgow Haskell Compiler User's Guide, Version 6.2|
|Prev||Chapter 12. Known bugs and infelicities||Next|
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 Section 4.7), 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.
GHC does not allow you to have a data type with a context that mentions type variables that are not data type parameters. For example:
data C a b => T a = MkT a
MkT :: forall a b. C a b => a -> T a
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 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.
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.
On Windows, there's a GNU ld/BFD bug whereby it emits bogus PE object files that have more than 0xffff relocations. When GHCi tries to load a package affected by this bug, you get an error message of the form
Loading package javavm ... linking ... Overflown relocs: 4
The workaround is to split up the .o files that make up your package into two or more .o's, along the lines of how the "base" package does it.