forked from mkotha/ghcguide_ja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runghc.xml
27 lines (20 loc) · 1.77 KB
/
runghc.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="runghc">
<title>runghcを使う</title>
<indexterm><primary>runghc</primary></indexterm>
<para>runghcは、Haskellプログラムをコンパイルせずに実行できるようにする。</para>
<sect1 id="runghc-introduction">
<title>フラグ</title>
<para>runghcのコマンド行はこのようになる</para>
<screen>
runghc [runghc flags] [GHC flags] module [program args]
</screen>
<para>runghcのフラグは、プログラムを走らせるのにどのGHCを使うかをrunghcに伝える<literal>-f /path/to/ghc</literal>と、使い方の情報を印字する<literal>--help</literal>である。これが与えられなかった場合、runghcはシステムの探索パスにあるディレクトリからGHCを探す。</para>
<para>runghcは<literal>[runghc flags]</literal>と<literal>[GHC flags]</literal>と<literal>[program args]</literal>の境界がどこかを推測しようとするが、間違った場合には<literal>--</literal>フラグを使うことができる。例えば、<literal>runghc -- -fwarn-unused-bindings Foo</literal>とすれば、runghcは、<literal>warn-unused-bindings</literal>をGHCのパスとして使おうとすることなく、このフラグをGHCに渡す。GHCのフラグがダッシュで始まっていない場合、それに<literal>--ghc-arg=</literal>を前置する必要がある。そうしなければ、runghcはそれを走らせるべきプログラムの名前だと考える。次のような場合である。<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: ***
-->