1 <?xml version="1.0" encoding="iso-8859-1"?>
3 <title>Using runghc</title>
4 <indexterm><primary>runghc</primary></indexterm>
6 <para>runghc allows you to run Haskell programs without first having
7 to compile them.</para>
9 <sect1 id="runghc-introduction">
12 <para>The runghc commandline looks like:</para>
14 runghc [runghc flags] [GHC flags] module [program args]
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>
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
35 <literal>runghc -package-conf --ghc-arg=foo.conf Main.hs</literal>.
43 ;;; Local Variables: ***
44 ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***