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