dots replaced by the directory separator ('/' or '\', depending
on the system), and <replaceable>extension</replaceable> is a
source extension (<literal>hs</literal>, <literal>lhs</literal>)
- if we are in <option>--make</option> mode and GHCi, or
+ if we are in <option>--make</option> mode or GHCi, or
<replaceable>hisuf</replaceable> otherwise.</para>
<para>For example, suppose the search path contains directories
<para>This isn't the whole story: GHC also looks for modules in
pre-compiled libraries, known as packages. See the section on
- packages (<xref linkend="packages"/>), for details.</para>
+ packages (<xref linkend="packages"/>) for details.</para>
</sect2>
<sect2 id="options-output">
<variablelist>
<varlistentry>
<term>
+ <option>-keep-hc-file</option>,
<option>-keep-hc-files</option>
+ <indexterm><primary><option>-keep-hc-file</option></primary></indexterm>
<indexterm><primary><option>-keep-hc-files</option></primary></indexterm>
</term>
<listitem>
<varlistentry>
<term>
+ <option>-keep-s-file</option>,
<option>-keep-s-files</option>
+ <indexterm><primary><option>-keep-s-file</option></primary></indexterm>
<indexterm><primary><option>-keep-s-files</option></primary></indexterm>
</term>
<listitem>
<varlistentry>
<term>
+ <option>-keep-raw-s-file</option>,
<option>-keep-raw-s-files</option>
+ <indexterm><primary><option>-keep-raw-s-file</option></primary></indexterm>
<indexterm><primary><option>-keep-raw-s-files</option></primary></indexterm>
</term>
<listitem>
</para>
<para>To compile these three files, issue the following commands:
<programlisting>
- ghc -c A.hs-boot -- Poduces A.hi-boot, A.o-boot
+ ghc -c A.hs-boot -- Produces A.hi-boot, A.o-boot
ghc -c B.hs -- Consumes A.hi-boot, produces B.hi, B.o
ghc -c A.hs -- Consumes B.hi, produces A.hi, A.o
ghc -o foo A.o B.o -- Linking the program
<listitem><para> A module <literal>M</literal> that is
<literal>{-# SOURCE #-}</literal>-imported in a program will usually also be
ordinarily imported elsewhere. If not, <command>ghc --make</command>
- automatically adds <literal>M</literal> to the set of moudles it tries to
+ automatically adds <literal>M</literal> to the set of modules it tries to
compile and link, to ensure that <literal>M</literal>'s implementation is included in
the final program.
</para></listitem>
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>
data R (x :: * -> *) y
</programlisting>
-You cannot use <literal>deriving</literal> on a data type declaration; write in
+You cannot use <literal>deriving</literal> on a data type declaration; write an
<literal>instance</literal> declaration instead.
</para></listitem>
<listitem><para> Class declarations is exactly as in Haskell, except that you may not put
<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>
<variablelist>
<varlistentry>
+ <term><option>-ddump-mod-cycles</option></term>
+ <listitem>
+ <para>Display a list of the cycles in the module graph. This is
+ useful when trying to eliminate such cycles. You do not need the <literal>-optdep</literal> prefix
+ for this flag.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-w</option></term>
<listitem>
<para>Turn off warnings about interface file shadowing.</para>
</listitem>
</varlistentry>
+<!-- Not currently implemented:
<varlistentry>
<term><option>––exclude-directory=<dirs></option></term>
<listitem>
the <option>––exclude-directory</option> option.</para>
</listitem>
</varlistentry>
+-->
<varlistentry>
<term><option>––include-pkg-deps</option></term>
class C a where ...
</programlisting>
Here, neither D nor T is declared in module Orphan.
-We call such modules ``orphan modules'',
+We call such modules “orphan modules”,
defined thus:</para>
<itemizedlist>
<listitem> <para> An <emphasis>orphan module</emphasis>
<listitem><para> An instance declaration in a module M is an <emphasis>orphan instance</emphasis> if
<indexterm><primary>orphan instance</primary></indexterm>
none of the type constructors
- or classes mentioned in the instance head (the part after the ``<literal>=></literal>'') are declared
+ or classes mentioned in the instance head (the part after the “<literal>=></literal>”) are declared
in M.</para>
<para> Only the instance head counts. In the example above, it is not good enough for C's declaration
<para> You can identify an orphan module by looking in its interface
file, <filename>M.hi</filename>, using the
-<option>--show-iface</option>. If there is a ``!'' on the first line,
-GHC considers it an orphan module.
+<option>--show-iface</option>. If there is a “!” on the
+first line, GHC considers it an orphan module.
</para>
</sect2>