<listitem>
<para>FFI libraries have been updated to the latest proposal
from the FFI task force. Too many changes to list here, see
- the docs: <xref linkend="sec-Foreign">.</para>
+ the docs: <xref linkend="Foreign">.</para>
</listitem>
</itemizedlist>
</sect2>
<literal>PutFullMVar</literal> exception no longer exists.
A non-blocking version of <function>putMVar</function>,
<function>tryPutMVar</function>, has been added (<xref
- linkend="sec-MVars">).</para>
+ linkend="MVars">).</para>
</listitem>
<listitem>
<para>The <literal>Int</literal> and
<literal>Integer</literal> types now have instances of
- <literal>Bits</literal> (<xref linkend="sec-Bits">).</para>
+ <literal>Bits</literal> (<xref linkend="Bits">).</para>
</listitem>
<listitem>
<para>Package <literal>hssource</literal> has been added. It
integral types.</para>
</listitem>
<listitem>
- <para>New modules: DiffArray (<xref linkend="sec-DiffArray">),
- StorableArray (<xref linkend="sec-StorableArray">),
+ <para>New modules: DiffArray (<xref linkend="DiffArray">),
+ StorableArray (<xref linkend="StorableArray">),
MonadList, MonadCont (no documentation yet).</para>
</listitem>
</itemizedlist>
<listitem>
<para>Explicit kind annotations can now be given on any
binding occurrence of a type variable. See <xref
- linkend="sec-kinding">.</para>
+ linkend="kinding">.</para>
</listitem>
<listitem>
<para>The handling of type synonyms has been rationalised.
when you compile with <option>-threaded</option>, you now get
an RTS flag <option>-N</option> that allows you to specify the
number of OS threads that GHC should use. Defaults to 1.
- See <xref linkend="sec-using-smp" /> and <xref
+ See <xref linkend="using-smp" /> and <xref
linkend="lang-parallel" />.
</para>
</listitem>
<programlisting>
f (x, y) | x `seq` False = undefined
| otherwise = [x,y]</programlisting>
- See <xref linkend="sec-bang-patterns" /> for more details.
+ See <xref linkend="bang-patterns" /> for more details.
</para>
</listitem>
<listitem>
<listitem>
<para>GHC implements a number of GHC-specific extensions to the FFI
- Addendum. These extensions are described in <xref linkend="sec-ffi-ghcexts" />, but please note that programs using
+ Addendum. These extensions are described in <xref linkend="ffi-ghcexts" />, but please note that programs using
these features are not portable. Hence, these features should be
avoided where possible.</para>
</listitem>
documentation; see for example the <literal>Foreign</literal>
module.</para>
- <sect1 id="sec-ffi-ghcexts">
+ <sect1 id="ffi-ghcexts">
<title>GHC extensions to the FFI Addendum</title>
<para>The FFI features that are described in this section are specific to
</sect1>
- <sect1 id="sec-ffi-ghc">
+ <sect1 id="ffi-ghc">
<title>Using the FFI with GHC</title>
<para>The following sections also give some hints and tips on the
</row>
<row>
<entry><option>-fbang-patterns</option></entry>
- <entry>Enable <link linkend="sec-bang-patterns">bang patterns</link>.</entry>
+ <entry>Enable <link linkend="bang-patterns">bang patterns</link>.</entry>
<entry>dynamic</entry>
<entry><option>-fno-bang-patterns</option></entry>
</row>
<indexterm><primary>FFI</primary><secondary>GHCi support</secondary></indexterm>
<indexterm><primary>Foreign Function Interface</primary><secondary>GHCi support</secondary></indexterm>
- <sect1>
+ <sect1 id="ghci-introduction">
<title>Introduction to GHCi</title>
<para>Let's start with an example GHCi session. You can fire up
enter, GHCi will attempt to evaluate it.</para>
</sect1>
- <sect1>
+ <sect1 id="loading-source-files">
<title>Loading source files</title>
<para>Suppose we have the following Haskell source code, which we
</sect1>
- <sect1>
+ <sect1 id="interactive-evaluation">
<title>Interactive evaluation at the prompt</title>
<para>When you type an expression at the prompt, GHCi immediately
<para>Syntactically, the declaration lacks the "= constrs" part. The
type can be parameterised over types of any kind, but if the kind is
not <literal>*</literal> then an explicit kind annotation must be used
-(see <xref linkend="sec-kinding"/>).</para>
+(see <xref linkend="kinding"/>).</para>
<para>Such data types have only one value, namely bottom.
Nevertheless, they can be useful when defining "phantom types".</para>
================ END OF Linear Implicit Parameters commented out -->
-<sect2 id="sec-kinding">
+<sect2 id="kinding">
<title>Explicitly-kinded quantification</title>
<para>
<!-- ==================== BANG PATTERNS ================= -->
-<sect1 id="sec-bang-patterns">
+<sect1 id="bang-patterns">
<title>Bang patterns
<indexterm><primary>Bang patterns</primary></indexterm>
</title>
Bang patterns are enabled by the flag <option>-fbang-patterns</option>.
</para>
-<sect2 id="sec-bang-patterns-informal">
+<sect2 id="bang-patterns-informal">
<title>Informal description of bang patterns
</title>
<para>
</sect2>
-<sect2 id="sec-bang-patterns-sem">
+<sect2 id="bang-patterns-sem">
<title>Syntax and semantics
</title>
<para>
<!-- ==================== ASSERTIONS ================= -->
-<sect1 id="sec-assertions">
+<sect1 id="assertions">
<title>Assertions
<indexterm><primary>Assertions</primary></indexterm>
</title>
automatically generate the dependencies required in order to
make sure that every module <emphasis>is</emphasis>
up-to-date with respect to its imported interfaces. Please
- see <xref linkend="sec-makefile-dependencies"/>.</para>
+ see <xref linkend="makefile-dependencies"/>.</para>
<para>If you are down to your
last-compile-before-a-bug-report, we would recommend that
<?xml version="1.0" encoding="iso-8859-1"?>
-<chapter id="sec-installing-bin-distrib">
+<chapter id="installing-bin-distrib">
<title>Installing GHC</title>
<indexterm><primary>binary installations</primary></indexterm>
<indexterm><primary>installation, of binaries</primary></indexterm>
<itemizedlist>
<listitem>
<para> Installing on Unix-a-likes (<xref
- linkend="sec-unix-a-likes"/>). </para>
+ linkend="unix-a-likes"/>). </para>
</listitem>
<listitem>
<para> Installing on Windows (<xref
- linkend="sec-install-windows"/>). </para>
+ linkend="install-windows"/>). </para>
</listitem>
<listitem>
<para> The layout of installed files (<xref
- linkend="sec-install-files"/>). You don't need to know this to
+ linkend="install-files"/>). You don't need to know this to
install GHC, but it's useful if you are changing the
implementation.</para>
</listitem>
</itemizedlist>
- <sect1 id="sec-unix-a-likes"><title>Installing on Unix-a-likes</title>
+ <sect1 id="unix-a-likes"><title>Installing on Unix-a-likes</title>
<sect2>
<title>When a platform-specific package is available</title>
<listitem>
<para>
the raw material from which the <literal>Makefile</literal>
-will be made (<xref linkend="sec-install"/>).
+will be made (<xref linkend="install"/>).
</para>
</listitem></varlistentry>
<varlistentry>
<term><literal>configure</literal></term>
<listitem>
<para>
-the configuration script (<xref linkend="sec-install"/>).
+the configuration script (<xref linkend="install"/>).
</para>
</listitem></varlistentry>
<varlistentry>
</variablelist>
</para>
-<sect3 id="sec-install">
+<sect3 id="install">
<title>Installing</title>
<para>
<para>
Once done, test your “installation” as suggested in
-<xref linkend="sec-GHC-test"/>. Be sure to use a <literal>-v</literal>
+<xref linkend="GHC-test"/>. Be sure to use a <literal>-v</literal>
option, so you can see exactly what pathnames it's using.
If things don't work as expected, check the list of known pitfalls in
</sect3>
-<sect3 id="sec-GHC-test">
+<sect3 id="GHC-test">
<title>Testing that GHC seems to be working
</title>
</sect1>
-<sect1 id="sec-install-windows"><title>Installing on Windows</title>
+<sect1 id="install-windows"><title>Installing on Windows</title>
<para>
Getting the Glasgow Haskell Compiler (post 5.02) to run on Windows platforms is
<varlistentry>
<term>I'm having trouble with symlinks.</term>
<listitem>
- <para>Symlinks only work under Cygwin (<xref linkend="sec-install" />), so binaries not linked to the Cygwin
+ <para>Symlinks only work under Cygwin (<xref linkend="install" />), so binaries not linked to the Cygwin
DLL, in particular those built for Mingwin, will not work with
symlinks.</para>
</listitem>
</sect1>
-<sect1 id="sec-install-files"><title>The layout of installed files</title>
+<sect1 id="install-files"><title>The layout of installed files</title>
<para>
This section describes what files get installed where. You don't need to know it
By default GHC runs your program on one processor; if you
want it to run in parallel you must link your program
with the <option>-threaded</option>, and run it with the RTS
- <option>-N</option> option; see <xref linkend="sec-using-smp" />).
+ <option>-N</option> option; see <xref linkend="using-smp" />).
The runtime will
schedule the running Haskell threads among the available OS
threads, running as many in parallel as you specified with the
<itemizedlist>
<listitem>
<para>Parallelism<indexterm><primary>parallelism</primary></indexterm> on a multiprocessor<indexterm><primary>multiprocessor</primary></indexterm><indexterm><primary>SMP</primary></indexterm> or multicore<indexterm><primary>multicore</primary></indexterm>
- machine. See <xref linkend="sec-using-smp" />.</para>
+ machine. See <xref linkend="using-smp" />.</para>
<para>The ability to make a foreign call that does not
block all other Haskell threads.</para>
<para>Sets the interval that the RTS clock ticks at. The
runtime uses a single timer signal to count ticks; this timer
signal is used to control the context switch timer (<xref
- linkend="sec-using-concurrent" />) and the heap profiling
+ linkend="using-concurrent" />) and the heap profiling
timer <xref linkend="rts-options-heap-prof" />. Also, the
time profiler uses the RTS timer signal directly to record
time profiling samples.</para>
<para>The RTS options related to profiling are described in <xref
linkend="rts-options-heap-prof"/>, those for concurrency in
- <xref linkend="sec-using-concurrent" />, and those for parallelism in
+ <xref linkend="using-concurrent" />, and those for parallelism in
<xref linkend="parallel-options"/>.</para>
</sect2>
it out precisely as in its real definition.</para>
<para>
If you do not write out the constructors, you may need to give a kind
- annotation (<xref linkend="sec-kinding"/>), to tell
+ annotation (<xref linkend="kinding"/>), to tell
GHC the kind of the type variable, if it is not "*". (In source files, this is worked out
from the way the type variable is used in the constructors.) For example:
<programlisting>
<literal>make</literal> looks for a rule to do so; one of the
preceding suffix rules does the job nicely. These dependencies
can be generated automatically by <command>ghc</command>; see
- <xref linkend="sec-makefile-dependencies"/></para>
+ <xref linkend="makefile-dependencies"/></para>
</sect2>
- <sect2 id="sec-makefile-dependencies">
+ <sect2 id="makefile-dependencies">
<title>Dependency generation</title>
<indexterm><primary>dependencies in Makefiles</primary></indexterm>
<indexterm><primary>Makefile dependencies</primary></indexterm>
<para>Dependency-generation mode. In this mode, GHC can be
used to generate dependency information suitable for use in
a <literal>Makefile</literal>. See <xref
- linkend="sec-makefile-dependencies"/>.</para>
+ linkend="makefile-dependencies"/>.</para>
</listitem>
</varlistentry>
<literal>Exception.assert</literal> in source code (in
other words, rewriting <literal>Exception.assert p
e</literal> to <literal>e</literal> (see <xref
- linkend="sec-assertions"/>). This flag is turned on by
+ linkend="assertions"/>). This flag is turned on by
<option>-O</option>.
</para>
</listitem>
&phases;
- <sect1 id="sec-using-concurrent">
+ <sect1 id="using-concurrent">
<title>Using Concurrent Haskell</title>
<indexterm><primary>Concurrent Haskell</primary><secondary>using</secondary></indexterm>
</variablelist>
</sect1>
- <sect1 id="sec-using-smp">
+ <sect1 id="using-smp">
<title>Using SMP parallelism</title>
<indexterm><primary>parallelism</primary>
</indexterm>
<chapter id="win32">
<title>Running GHC on Win32 systems</title>
-<sect1>
+<sect1 id="ghc-windows">
<title>
Starting GHC on Windows platforms</title>
module.</para>
</sect1>
-<sect1>
+<sect1 id="terminal-interaction">
<title>
Interacting with the terminal</title>
</sect1>
-<sect1>
+<sect1 id="library-differences">
<title>
Differences in library behaviour </title>
</para>
</sect1>
-<sect1>
+<sect1 id="ghci-cygwin">
<title>
Using GHC (and other GHC-compiled executables) with cygwin</title>