blob: 0681f00851edeab92f9f8df5e126438efb4f191b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<?xml version="1.0" encoding="iso-8859-1"?>
<chapter id="runghc">
<title>Using runghc</title>
<indexterm><primary>runghc</primary></indexterm>
<para>runghc allows you to run Haskell programs without first having
to compile them.</para>
<sect1 id="runghc-introduction">
<title>Flags</title>
<para>The runghc commandline looks like:</para>
<screen>
runghc [runghc flags] [GHC flags] module [program args]
</screen>
<para>The runghc flags are
<literal>-f /path/to/ghc</literal>,
which tells runghc which GHC to use to run the program,
and <literal>--help</literal>, which prints usage information. If it is
not given then runghc will search for GHC in the directories in the
system search path.</para>
<para>runghc will try to work out where the boundaries between
<literal>[runghc flags]</literal> and
<literal>[GHC flags]</literal>, and
<literal>[program args]</literal> and
<literal>module</literal> are, but you can use a
<literal>--</literal> flag if it doesn't get it right. For example,
<literal>runghc -- -fwarn-unused-bindings Foo</literal> means runghc
won't try to use <literal>warn-unused-bindings</literal> as the path to GHC,
but instead will pass the flag to GHC. If a GHC flag doesn't start
with a dash then you need to prefix it with
<literal>--ghc-arg=</literal> or runghc will think that it is the
program to run, e.g.
<literal>runghc -package-conf --ghc-arg=foo.conf Main.hs</literal>.
</para>
</sect1>
</chapter>
<!-- Emacs stuff:
;;; Local Variables: ***
;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
;;; End: ***
-->
|