X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=7a918a8f49ad1908a59c085d54c1228f17d0a6a3;hb=bec18cb3a1dcbc70b0257a367091c9a5948da6f6;hp=8a213683e4edfdd881f2acdb97b9ddfbebdac50b;hpb=f2dcf256399e9a2de6343c625630b51f8abf4863;p=ghc-hetmet.git
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 8a21368..7a918a8 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -140,7 +140,7 @@ documentation describes all the libraries that come with GHC.
-
+
@@ -617,7 +617,7 @@ clunky env var1 var1 = case lookup env var1 of
Nothing -> fail
Just val2 -> val1 + val2
where
- fail = val1 + val2
+ fail = var1 + var2
@@ -2090,7 +2090,7 @@ option, you can use arbitrary
types in both an instance context and instance head. Termination is ensured by having a
fixed-depth recursion stack. If you exceed the stack depth you get a
sort of backtrace, and the opportunity to increase the stack depth
-with N.
+with N.
@@ -2107,7 +2107,9 @@ can be modified by two flags:
and
-fallow-incoherent-instances
-, as this section discusses.
+, as this section discusses. Both these
+flags are dynamic flags, and can be set on a per-module basis, using
+an OPTIONS_GHC pragma if desired ().
When GHC tries to resolve, say, the constraint C Int Bool,
it tries to match every instance declaration against the
@@ -4236,7 +4238,46 @@ Hello
+
+
+Using Template Haskell with Profiling
+profilingwith Template Haskell
+Template Haskell relies on GHC's built-in bytecode compiler and
+interpreter to run the splice expressions. The bytecode interpreter
+runs the compiled expression on top of the same runtime on which GHC
+itself is running; this means that the compiled code referred to by
+the interpreted expression must be compatible with this runtime, and
+in particular this means that object code that is compiled for
+profiling cannot be loaded and used by a splice
+expression, because profiled object code is only compatible with the
+profiling version of the runtime.
+
+This causes difficulties if you have a multi-module program
+containing Template Haskell code and you need to compile it for
+profiling, because GHC cannot load the profiled object code and use it
+when executing the splices. Fortunately GHC provides a workaround.
+The basic idea is to compile the program twice:
+
+
+
+ Compile the program or library first the normal way, without
+ .
+
+
+ Then compile it again with , and
+ additionally use
+ to name the object files differentliy (you can choose any suffix
+ that isn't the normal object suffix here). GHC will automatically
+ load the object files built in the first step when executing splice
+ expressions. If you omit the flag when
+ building with and Template Haskell is used,
+ GHC will emit an error message.
+
+
+
+
@@ -5339,7 +5380,9 @@ The programmer can specify rewrite rules as part of the source program
(in a pragma). GHC applies these rewrite rules wherever it can, provided (a)
the flag () is on,
and (b) the flag
-() is not specified.
+() is not specified, and (c) the
+ ()
+flag is active.