X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Ffaq.sgml;h=0c274d79c86e7b78a11f2748782394bd416dc5de;hb=904e1d6721f405a0c6fead4009472189593a897e;hp=dd7225bb4986fc6fc04b8e648539d15460ab2935;hpb=89418e67066fb75ee08a482617106e2fa7af4d41;p=ghc-hetmet.git
diff --git a/ghc/docs/users_guide/faq.sgml b/ghc/docs/users_guide/faq.sgml
index dd7225b..0c274d7 100644
--- a/ghc/docs/users_guide/faq.sgml
+++ b/ghc/docs/users_guide/faq.sgml
@@ -45,6 +45,34 @@
+ Do I have to recompile all my code if I upgrade
+ GHC?
+
+ Yes. There are two reasons for this:
+
+
+ GHC does a lot of cross-module optimisation, so
+ compiled code will include parts of the libraries it was
+ compiled against (including the Prelude), so will be
+ deeply tied to the actual version of those libraries it
+ was compiled against. When you upgrade GHC, the libraries
+ may change; even if the external interface of the
+ libraries doesn't change, sometimes internal details may
+ change because GHC optimised the code in the library
+ differently.
+
+
+ We sometimes change the ABI (application binary
+ interface) between versions of GHC. Code compiled with
+ one version of GHC is not necessarily compatible with code
+ compiled by a different version, even if you arrange to
+ keep the same libraries.
+
+
+
+
+
+ Why doesn't GHC use shared libraries?The subject of shared libraries has come up several
@@ -202,6 +230,99 @@
with g++ and gcc 3.0.
+
+
+ My program is failing with head [], or
+ an array bounds error, or some other random error, and I have no
+ idea how to find the bug. Can you help?
+
+
+ Compile your program with -prof
+-auto-all (make sure you have the profiling libraries
+installed), and run it with +RTS -xc -RTS to get a
+“stack trace” at the point at which the exception was
+raised. See for more
+details.
+
+
+
+
+ How do I increase the heap size permanently for a given
+ binary?
+
+ See .
+
+
+
+
+ I'm trying to compile my program for parallel execution
+ with the , and GHC complains with an
+ error like “failed to load interface file for
+ Prelude”.
+
+ GHC doesn't ship with support for parallel execution,
+ that support is provided separately by the GPH project.
+
+
+
+
+ When is it safe to use
+ unsafePerformIO?
+
+ We'll give two answers to this question, each of which
+ may be helpful. These criteria are not rigorous in any real
+ sense (you'd need a formal semantics for Haskell in order to
+ give a proper answer to this question), but should give you a
+ feel for the kind of things you can and cannot do with
+ unsafePerformIO.
+
+
+
+ It is safe to implement a function or API using
+ unsafePerformIO if you could imagine
+ also implementing the same function or API in Haskell
+ without using unsafePerformIO (forget
+ about efficiency, just consider the semantics).
+
+
+
+ In pure Haskell, the value of a function depends
+ only on the values of its arguments (and free variables,
+ if it has any). If you can implement the function using
+ unsafePerformIO and still retain this
+ invariant, then you're probably using
+ unsafePerformIO in a safe way. Note
+ that you need only consider the
+ observable values of the arguments
+ and result.
+
+
+
+ For more information, see this
+ thread.
+
+
+
+
+ Why does linking take so long?
+
+ Linking a small program should take no more than a few
+ seconds. Larger programs can take longer, but even linking
+ GHC itself only takes 3-4 seconds on our development
+ machines.
+
+ Long link times have been attributed to using Sun's
+ linker on Solaris, as compared to GNU ld
+ which appears to be much faster. So if you're on a Sun box,
+ try switching to GNU ld. This
+ article from the mailing list has more
+ information.
+
+
+