flags.xml 58.5 KB
Newer Older
1
<?xml version="1.0" encoding="iso-8859-1"?>
2
  <sect1 id="flag-reference">
3 4
    <title>Flag reference</title>

5 6
    <para>This section is a quick-reference for GHC's command-line
    flags.  For each flag, we also list its static/dynamic status (see
7
    <xref linkend="static-dynamic-flags"/>), and the flag's opposite
8 9
    (if available).</para>

10
    <sect2>
11 12 13
      <title>Help and verbosity options</title>

      <para><xref linkend="options-help"/></para>
14 15

      <informaltable>
16
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
17 18 19 20 21 22 23 24 25 26 27 28
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-?</option></entry>
	      <entry>help</entry>
29
	      <entry>mode</entry>
30 31 32 33 34
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-help</option></entry>
	      <entry>help</entry>
35
	      <entry>mode</entry>
36 37
	      <entry>-</entry>
	    </row>
38 39 40 41 42 43
	    <row>
	      <entry><option>-n</option></entry>
	      <entry>do a dry run</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
44 45 46 47 48 49 50 51 52 53 54 55
	    <row>
	      <entry><option>-v</option></entry>
	      <entry>verbose mode (equivalent to <option>-v3</option>)</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-v</option><replaceable>n</replaceable></entry>
	      <entry>set verbosity level</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
56 57 58
	    <row>
	      <entry><option>-V</option></entry>
	      <entry>display GHC version</entry>
59
	      <entry>mode</entry>
60 61
	      <entry>-</entry>
	    </row>
62
	    <row>
63
	      <entry><option>&ndash;&ndash;version</option></entry>
64
	      <entry>display GHC version</entry>
65
	      <entry>mode</entry>
66 67 68
	      <entry>-</entry>
	    </row>
	    <row>
69
	      <entry><option>&ndash;&ndash;numeric-version</option></entry>
70
	      <entry>display GHC version (numeric only)</entry>
71
	      <entry>mode</entry>
72 73
	      <entry>-</entry>
	    </row>
74
	    <row>
75
	      <entry><option>&ndash;&ndash;print-libdir</option></entry>
76
	      <entry>display GHC library directory</entry>
77
	      <entry>mode</entry>
78 79
	      <entry>-</entry>
	    </row>
80 81 82 83 84 85
	    <row>
	      <entry><option>-ferror-spans</option></entry>
	      <entry>output full span in error messages</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
86 87 88 89 90 91
	    <row>
	      <entry><option>-H</option><replaceable>size</replaceable></entry>
	      <entry>Set the minimum heap size to <replaceable>size</replaceable></entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
92 93 94 95 96 97
	    <row>
	      <entry><option>-Rghc-timing</option></entry>
	      <entry>Summarise timing stats for GHC (same as <literal>+RTS -tstderr</literal>)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
98 99 100 101 102 103
	  </tbody>
	</tgroup>
      </informaltable>

    </sect2>
    <sect2>
104
      <title>Which phases to run</title>
105
      
106 107
      <para><xref linkend="options-order"/></para>

108
      <informaltable>
109
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
110 111 112 113 114 115 116 117 118 119 120 121
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-E</option></entry>
	      <entry>Stop after preprocessing (<literal>.hspp</literal> file)</entry>
122
	      <entry>mode</entry>
123 124 125 126 127
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-C</option></entry>
	      <entry>Stop after generating C (<literal>.hc</literal> file)</entry>
128
	      <entry>mode</entry>
129 130 131 132 133
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-S</option></entry>
	      <entry>Stop after generating assembly (<literal>.s</literal> file)</entry>
134
	      <entry>mode</entry>
135 136 137 138
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-c</option></entry>
139 140
	      <entry>Do not link</entry>
	      <entry>dynamic</entry>
141 142
	      <entry>-</entry>
	    </row>
143 144 145 146 147 148
	    <row>
	      <entry><option>-x</option> <replaceable>suffix</replaceable></entry>
	      <entry>Override default behaviour for source files</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
149 150 151
	  </tbody>
	</tgroup>
      </informaltable>
152 153 154
    </sect2>

     <sect2>
155
      <title>Alternative modes of operation</title>
156
      
157 158
      <para><xref linkend="modes"/></para>

159
      <informaltable>
160
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
161 162 163 164 165 166 167 168 169 170 171
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>--interactive</option></entry>
172 173
	      <entry>Interactive mode - normally used by just running <command>ghci</command>;
	      see <xref linkend="ghci"/> for details.</entry>
174
	      <entry>mode</entry>
175 176 177 178
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>--make</option></entry>
179 180
	      <entry>Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using <command>make</command>;
	      see <xref linkend="make-mode"/> for details..</entry>
181
	      <entry>mode</entry>
182 183 184 185
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-e <replaceable>expr</replaceable></option></entry>
186 187
	      <entry>Evaluate <replaceable>expr</replaceable>;
	      see <xref linkend="eval-mode"/> for details.</entry>
188
	      <entry>mode</entry>
189 190 191 192
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-M</option></entry>
193 194
	      <entry>Generate dependency information suitable for use in a <filename>Makefile</filename>;
	      see <xref linkend="makefile-dependencies"/> for details.</entry>
195
	      <entry>mode</entry>
196 197 198 199 200
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
201 202 203
    </sect2>

    <sect2>
204
      <title>Redirecting output</title>
205
      
206 207
      <para><xref linkend="options-output"/></para>

208
      <informaltable>
209
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
210 211 212 213 214 215 216 217 218
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
219 220 221
	    <row>
	      <entry><option>-hcsuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for intermediate C files</entry>
222
	      <entry>dynamic</entry>
223 224
	      <entry>-</entry>
	    </row>
225 226 227
	    <row>
	      <entry><option>-hidir</option> <replaceable>dir</replaceable></entry>
	      <entry>set directory for interface files</entry>
228
	      <entry>dynamic</entry>
229 230
	      <entry>-</entry>
	    </row>
231 232 233
	    <row>
	      <entry><option>-hisuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for interface files</entry>
234
	      <entry>dynamic</entry>
235 236 237 238 239
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-o</option> <replaceable>filename</replaceable></entry>
	      <entry>set output filename</entry>
240
	      <entry>dynamic</entry>
241 242 243 244 245
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
	      <entry>set output directory</entry>
246
	      <entry>dynamic</entry>
247 248 249 250 251
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ohi</option> <replaceable>filename</replaceable></entry>
	      <entry>set the filename in which to put the interface</entry>
252
	      <entry>dynamic</entry>
253 254 255 256 257
	      <entry></entry>
	    </row>
	    <row>
	      <entry><option>-osuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the output file suffix</entry>
258
	      <entry>dynamic</entry>
259 260
	      <entry>-</entry>
	    </row>
261 262 263 264 265 266
	    <row>
	      <entry><option>-stubdir</option> <replaceable>dir</replaceable></entry>
	      <entry>redirect FFi stub files</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
267 268 269 270 271 272
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
273 274 275
      <title>Keeping intermediate files</title>
      
      <para><xref linkend="keeping-intermediates"/></para>
276 277
      
      <informaltable>
278
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
279 280 281 282 283 284 285 286 287 288 289 290
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-keep-hc-file</option></entry>
	      <entry>retain intermediate <literal>.hc</literal> files</entry>
291
	      <entry>dynamic</entry>
292 293 294 295 296
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-s-file</option></entry>
	      <entry>retain intermediate <literal>.s</literal> files</entry>
297
	      <entry>dynamic</entry>
298 299 300 301 302
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-raw-s-file</option></entry>
	      <entry>retain intermediate <literal>.raw_s</literal> files</entry>
303
	      <entry>dynamic</entry>
304 305 306 307 308
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-tmp-files</option></entry>
	      <entry>retain all intermediate temporary files</entry>
309
	      <entry>dynamic</entry>
310 311 312 313 314 315 316 317
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
318
      <title>Temporary files</title>
319
      
320 321
      <para><xref linkend="temp-files"/></para>

322
      <informaltable>
323
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
324 325 326 327 328 329 330 331 332 333 334 335
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-tmpdir</option></entry>
	      <entry>set the directory for temporary files</entry>
336
	      <entry>dynamic</entry>
337 338 339 340 341 342 343 344
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
345 346 347
      <title>Finding imports</title>

      <para><xref linkend="search-path"/></para>
348 349

      <informaltable>
350
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
351 352 353 354 355 356 357 358 359 360 361 362 363 364
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-i</option><replaceable>dir1</replaceable>:<replaceable>dir2</replaceable>:...</entry>
	      <entry>add <replaceable>dir</replaceable>,
	          <replaceable>dir2</replaceable>, etc. to import path</entry>
365
	      <entry>static/<literal>:set</literal></entry>
366 367 368 369 370
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-i</option></entry>
	      <entry>Empty the import directory list</entry>
371
	      <entry>static/<literal>:set</literal></entry>
372 373 374 375 376 377 378 379
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
380 381 382
      <title>Interface file options</title>

      <para><xref linkend="hi-options"/></para>
383 384

      <informaltable>
385
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-ddump-hi</option></entry>
	      <entry>Dump the new interface to stdout</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-hi-diffs</option></entry>
	      <entry>Show the differences vs. the old interface</entry>
	      <entry>dynamic</entry>
406 407 408 409 410 411
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-minimal-imports</option></entry>
	      <entry>Dump a minimal set of imports</entry>
	      <entry>dynamic</entry>
412 413
	      <entry>-</entry>
	    </row>
414 415 416 417 418
	    <row>
	      <entry><option>--show-iface</option> <replaceable>file</replaceable></entry>
	      <entry>Read the interface in
	      <replaceable>file</replaceable> and dump it as text to
	      <literal>stdout</literal>.</entry>
419
	      <entry>mode</entry>
420 421
	      <entry>-</entry>
	    </row>
422 423 424 425 426 427
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
    
    <sect2>
428 429 430
      <title>Recompilation checking</title>

      <para><xref linkend="recomp"/></para>
431 432

      <informaltable>
433
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
434 435 436 437 438 439 440 441 442 443 444
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
445
	      <entry><option>-fforce-recomp</option></entry>
446 447 448
	      <entry>Turn off recompilation checking; implied by any
	      <option>-ddump-X</option> option</entry>
	      <entry>dynamic</entry>
449
	      <entry><option>-fno-force-recomp</option></entry>
450 451 452 453 454 455 456
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
457
      <title>Interactive-mode options</title>
458
      
459 460
      <para><xref linkend="ghci-dot-files"/></para>

461
      <informaltable>
462
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
463
	  <thead>
464
	    <row>
465 466 467 468 469 470 471 472
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
473 474
	      <entry><option>-ignore-dot-ghci</option></entry>
	      <entry>Disable reading of <filename>.ghci</filename> files</entry>
475 476 477 478
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
479 480
	      <entry><option>-read-dot-ghci</option></entry>
	      <entry>Enable reading of <filename>.ghci</filename> files</entry>
481 482 483
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
mnislaih's avatar
mnislaih committed
484 485 486 487 488 489 490 491 492 493 494 495
	    <row>
	      <entry><option>-fdebugging</option></entry>
	      <entry>Generate bytecode enabled for debugging</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-fno-debugging</option></entry>
	      <entry>Do not include debugging information in bytecodes</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
496 497 498 499 500 501
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
502 503 504 505
      <title>Packages</title>

      <para><xref linkend="packages"/></para>

506
      <informaltable>
507
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
508 509 510 511 512 513 514 515 516
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
517 518 519 520 521 522
	    <row>
	      <entry><option>-package-name</option> <replaceable>P</replaceable></entry>
	      <entry>Compile to be part of package <replaceable>P</replaceable></entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
523
	    <row>
524 525
	      <entry><option>-package</option> <replaceable>P</replaceable></entry>
	      <entry>Expose package <replaceable>P</replaceable></entry>
526
	      <entry>static/<literal>:set</literal></entry>
527
	      <entry>-</entry>
528 529 530 531 532 533
	    </row>
	    <row>
	      <entry><option>-hide-all-packages</option></entry>
	      <entry>Hide all packages by default</entry>
	      <entry>static</entry>
	      <entry>-</entry>
534 535 536 537
	    </row>
	    <row>
	      <entry><option>-hide-package</option> <replaceable>name</replaceable></entry>
	      <entry>Hide package <replaceable>P</replaceable></entry>
538
	      <entry>static/<literal>:set</literal></entry>
539 540 541 542 543
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ignore-package</option> <replaceable>name</replaceable></entry>
	      <entry>Ignore package <replaceable>P</replaceable></entry>
544
	      <entry>static/<literal>:set</literal></entry>
545 546 547
	      <entry>-</entry>
	    </row>
	    <row>
548 549
	      <entry><option>-package-conf</option> <replaceable>file</replaceable></entry>
	      <entry>Load more packages from <replaceable>file</replaceable></entry>
550
	      <entry>static</entry>
551 552 553
	      <entry>-</entry>
	    </row>
	    <row>
554 555
	      <entry><option>-no-user-package-conf</option></entry>
	      <entry>Don't load the user's package config file.</entry>
556
	      <entry>static</entry>
557 558 559 560 561 562 563 564
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
565 566 567
      <title>Language options</title>

      <para><xref linkend="options-language"/></para>
568 569

      <informaltable>
570
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
571 572 573 574 575 576 577 578 579 580 581
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fallow-overlapping-instances</option></entry>
582
	      <entry>Enable <link linkend="instance-overlap">overlapping instances</link></entry>
583 584 585
	      <entry>dynamic</entry>
	      <entry><option>-fno-allow-overlapping-instances</option></entry>
	    </row>
586 587
	    <row>
	      <entry><option>-fallow-incoherent-instances</option></entry>
588
	      <entry>Enable <link linkend="instance-overlap">incoherent instances</link>.  
589
	      Implies <option>-fallow-overlapping-instances</option> </entry>
590 591 592 593
	      <entry>dynamic</entry>
	      <entry><option>-fno-allow-incoherent-instances</option></entry>
	    </row>
	    <row>
594 595
	      <entry><option>-fallow-undecidable-instances</option></entry>
	      <entry>Enable <link linkend="undecidable-instances">undecidable instances</link></entry>
596
	      <entry>dynamic</entry>
597
	      <entry><option>-fno-allow-undecidable-instances</option></entry>
598
	    </row>
599
	    <row>
600
	      <entry><option>-fcontext-stack=N</option><replaceable>n</replaceable></entry>
601
	      <entry>set the <link linkend="undecidable-instances">limit for context reduction</link></entry>
602 603
	      <entry>dynamic</entry>
	      <entry><option>20</option></entry>
604
	    </row>
605 606 607 608 609 610 611
	    <row>
	      <entry><option>-farrows</option></entry>
	      <entry>Enable <link linkend="arrow-notation">arrow
	      notation</link> extension</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-arrows</option></entry>
	    </row>
chak's avatar
chak committed
612 613
	    <row>
	      <entry><option>-ffi</option> or <option>-fffi</option></entry>
614
	      <entry>Enable <link linkend="ffi">foreign function interface</link> (implied by
chak's avatar
chak committed
615 616 617
	      <option>-fglasgow-exts</option>)</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-ffi</option></entry>
ross's avatar
ross committed
618 619
	    </row>
	    <row>
620
	      <entry><option>-fgenerics</option></entry>
621
	      <entry>Enable <link linkend="generic-classes">generic classes</link></entry>
ross's avatar
ross committed
622
	      <entry>dynamic</entry>
623
	      <entry><option>-fno-fgenerics</option></entry>
chak's avatar
chak committed
624 625
	    </row>
	    <row>
626 627
	      <entry><option>-fglasgow-exts</option></entry>
	      <entry>Enable most language extensions</entry>
chak's avatar
chak committed
628
	      <entry>dynamic</entry>
629
	      <entry><option>-fno-glasgow-exts</option></entry>
chak's avatar
chak committed
630
	    </row>
631 632
	    <row>
	      <entry><option>-fimplicit-params</option></entry>
633
	      <entry>Enable <link linkend="implicit-parameters">Implicit Parameters</link>.
634
	      Implied by <option>-fglasgow-exts</option>.</entry>
635 636 637 638 639 640 641 642 643
	      <entry>dynamic</entry>
	      <entry><option>-fno-implicit-params</option></entry>
	    </row>
	    <row>
	      <entry><option>-firrefutable-tuples</option></entry>
	      <entry>Make tuple pattern matching irrefutable</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-irrefutable-tuples</option></entry>
	    </row>
644 645 646 647
	    <row>
	      <entry><option>-fno-implicit-prelude</option></entry>
	      <entry>Don't implicitly <literal>import Prelude</literal></entry>
	      <entry>dynamic</entry>
648
	      <entry><option>-fimplicit-prelude</option></entry>
649 650 651
	    </row>
	    <row>
	      <entry><option>-fno-monomorphism-restriction</option></entry>
652
	      <entry>Disable the <link linkend="monomorphism">monomorphism restriction</link></entry>
653
	      <entry>dynamic</entry>
654
	      <entry><option>-fmonomorphism-restriction</option></entry>
655
	    </row>
656 657
	    <row>
	      <entry><option>-fno-mono-pat-binds</option></entry>
658
	      <entry>Make <link linkend="monomorphism">pattern bindings polymorphic</link></entry>
659 660 661 662 663
	      <entry>dynamic</entry>
	      <entry><option>-fmono-pat-binds</option></entry>
	    </row>
	    <row>
	      <entry><option>-fextended-default-rules</option></entry>
664
	      <entry>Use GHCi's <link linkend="extended-default-rules">extended default rules</link> in a normal module</entry>
665 666 667
	      <entry>dynamic</entry>
	      <entry><option>-fno-extended-default-rules</option></entry>
	    </row>
668 669 670 671 672 673 674
	    <row>
	      <entry><option>-foverloaded-strings</option></entry>
	      <entry>Enable <link linkend="overloaded-strings">overloaded string literals</link>.
	      </entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-overloaded-strings</option></entry>
	    </row>
675 676
	    <row>
	      <entry><option>-fscoped-type-variables</option></entry>
677
	      <entry>Enable <link linkend="scoped-type-variables">lexically-scoped type variables</link>.
678 679 680 681
	      Implied by <option>-fglasgow-exts</option>.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-scoped-type-variables</option></entry>
	    </row>
682
	    <row>
683
	      <entry><option>-fth</option></entry>
684
	      <entry>Enable <link linkend="template-haskell">Template Haskell</link>. 
685
		No longer implied by <option>-fglasgow-exts</option>.</entry>
686
	      <entry>dynamic</entry>
687
	      <entry><option>-fno-th</option></entry>
688
	    </row>
689 690
	    <row>
	      <entry><option>-fbang-patterns</option></entry>
691
	      <entry>Enable <link linkend="bang-patterns">bang patterns</link>.</entry>
692 693 694
	      <entry>dynamic</entry>
	      <entry><option>-fno-bang-patterns</option></entry>
	    </row>
695 696 697 698 699 700
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
701
      <title>Warnings</title>
702
      
703
      <para><xref linkend="options-sanity"/></para>
704

705
    <informaltable>
706
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
707 708 709 710 711 712 713 714 715 716 717 718
	<thead>
	  <row>
	    <entry>Flag</entry>
	    <entry>Description</entry>
	    <entry>Static/Dynamic</entry>
	    <entry>Reverse</entry>
	  </row>
	</thead>
	<tbody>
	  <row>
	    <entry><option>-W</option></entry>
	    <entry>enable normal warnings</entry>
719
	    <entry>dynamic</entry>
720 721 722 723 724
	    <entry><option>-w</option></entry>
	  </row>
	  <row>
	    <entry><option>-w</option></entry>
	    <entry>disable all warnings</entry>
725
	    <entry>dynamic</entry>
726 727 728 729 730
	    <entry>-</entry>
	  </row>
	  <row>
	    <entry><option>-Wall</option></entry>
	    <entry>enable all warnings</entry>
731
	    <entry>dynamic</entry>
732 733
	    <entry><option>-w</option></entry>
	  </row>
734 735 736 737 738 739
	  <row>
	    <entry><option>-Werror</option></entry>
	    <entry>make warnings fatal</entry>
	    <entry>dynamic</entry>
	    <entry></entry>
	  </row>
740 741 742

	  <row>
	    <entry><option>-fwarn-deprecations</option></entry>
743
	    <entry>warn about uses of functions &amp; types that are deprecated</entry>
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-deprecations</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-duplicate-exports</option></entry>
	    <entry>warn when an entity is exported multiple times</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-duplicate-exports</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-hi-shadowing</option></entry>
	    <entry>warn when a <literal>.hi</literal> file in the
	    current directory shadows a library</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-hi-shadowing</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-incomplete-patterns</option></entry>
	    <entry>warn when a pattern match could fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-incomplete-patterns</option></entry>
	  </row>

770 771 772 773 774 775 776
	  <row>
	    <entry><option>-fwarn-incomplete-record-updates</option></entry>
	    <entry>warn when a record update could fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-incomplete-record-updates</option></entry>
	  </row>

777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804
	  <row>
	    <entry><option>-fwarn-missing-fields</option></entry>
	    <entry>warn when fields of a record are uninitialised</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-fields</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-missing-methods</option></entry>
	    <entry>warn when class methods are undefined</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-methods</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-missing-signatures</option></entry>
	    <entry>warn about top-level functions without signatures</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-missing-signatures</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-name-shadowing</option></entry>
	    <entry>warn when names are shadowed</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-name-shadowing</option></entry>
	  </row>

805
	  <row>
Ian Lynagh's avatar
Ian Lynagh committed
806
	    <entry><option>-fwarn-orphans</option></entry>
807 808 809 810 811 812
	    <entry>warn when the module contains "orphan" instance declarations
	    or rewrite rules</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-orphans</option></entry>
	  </row>

813 814 815 816 817 818 819 820 821 822 823 824 825 826
	  <row>
	    <entry><option>-fwarn-overlapping-patterns</option></entry>
	    <entry>warn about overlapping patterns</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-overlapping-patterns</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-simple-patterns</option></entry>
	    <entry>warn about lambda-patterns that can fail</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-simple-patterns</option></entry>
	  </row>

827 828 829 830 831 832 833
	  <row>
	    <entry><option>-fwarn-tabs</option></entry>
	    <entry>warn if there are tabs in the source file</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-tabs</option></entry>
	  </row>

834 835 836 837 838 839 840
	  <row>
	    <entry><option>-fwarn-type-defaults</option></entry>
	    <entry>warn when defaulting happens</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-type-defaults</option></entry>
	  </row>

841 842 843 844 845 846 847
	  <row>
	    <entry><option>-fwarn-monomorphism-restriction</option></entry>
	    <entry>warn when the Monomorphism Restriction is applied</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-monomorphism-restriction</option></entry>
	  </row>

848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874
	  <row>
	    <entry><option>-fwarn-unused-binds</option></entry>
	    <entry>warn about bindings that are unused</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-binds</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-unused-imports</option></entry>
	    <entry>warn about unnecessary imports</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-imports</option></entry>
	  </row>

	  <row>
	    <entry><option>-fwarn-unused-matches</option></entry>
	    <entry>warn about variables in patterns that aren't used</entry>
	    <entry>dynamic</entry>
	    <entry><option>-fno-warn-unused-matches</option></entry>
	  </row>

	  </tbody>
	</tgroup>
      </informaltable>

    </sect2>
    <sect2>
875 876 877
      <title>Optimisation levels</title>

      <para><xref linkend="options-optimise"/></para>
878 879

      <informaltable>
880
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
881 882 883 884 885 886 887 888 889 890 891 892
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-O</option></entry>
	      <entry>Enable default optimisation (level 1)</entry>
893
	      <entry>dynamic</entry>
894 895 896 897 898
	      <entry><option>-O0</option></entry>
	    </row>
	    <row>
	      <entry><option>-O</option><replaceable>n</replaceable></entry>
	      <entry>Set optimisation level <replaceable>n</replaceable></entry>
899
	      <entry>dynamic</entry>
900 901 902 903 904 905 906 907
	      <entry><option>-O0</option></entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
	      
    </sect2>
    <sect2>
908 909 910
      <title>Individual optimisations</title>

      <para><xref linkend="options-f"/></para>
911 912

      <informaltable>
913
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
914 915 916 917 918 919 920 921 922 923 924 925
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-fcase-merge</option></entry>
	      <entry>Enable case-merging</entry>
926
	      <entry>dynamic</entry>
927 928 929 930 931 932
	      <entry><option>-fno-case-merge</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdicts-strict</option></entry>
	      <entry>Make dictionaries strict</entry>
933
	      <entry>static</entry>
934 935 936 937 938 939
	      <entry><option>-fno-dicts-strict</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdo-eta-reduction</option></entry>
	      <entry>Enable eta-reduction</entry>
940
	      <entry>dynamic</entry>
941 942 943 944 945 946
	      <entry><option>-fno-do-eta-reduction</option></entry>
	    </row>

	    <row>
	      <entry><option>-fdo-lambda-eta-expansion</option></entry>
	      <entry>Enable lambda eta-reduction</entry>
947
	      <entry>dynamic</entry>
948 949 950 951 952 953
	      <entry><option>-fno-do-lambda-eta-expansion</option></entry>
	    </row>

	    <row>
	      <entry><option>-fexcess-precision</option></entry>
	      <entry>Enable excess intermediate precision</entry>
954
	      <entry>dynamic</entry>
955 956 957 958
	      <entry><option>-fno-excess-precision</option></entry>
	    </row>

	    <row>
959
	      <entry><option>-frules-off</option></entry>
960 961
	      <entry>Switch off all rewrite rules (including rules
	      generated by automatic specialisation of overloaded functions)</entry>
962
	      <entry>static</entry>
963
	      <entry><option>-frules-off</option></entry>
964 965 966 967 968
	    </row>

	    <row>
	      <entry><option>-fignore-asserts</option></entry>
	      <entry>Ignore assertions in the source</entry>
969
	      <entry>dynamic</entry>
970 971 972 973 974 975
	      <entry><option>-fno-ignore-asserts</option></entry>
	    </row>

	    <row>
	      <entry><option>-fignore-interface-pragmas</option></entry>
	      <entry>Ignore pragmas in interface files</entry>
976
	      <entry>dynamic</entry>
977 978 979 980 981
	      <entry><option>-fno-ignore-interface-pragmas</option></entry>
	    </row>

	    <row>
	      <entry><option>-fliberate-case-threshold</option></entry>
chak's avatar
chak committed
982
	      <entry>Tweak the liberate-case optimisation (default: 10)</entry>
983 984 985 986 987 988 989
	      <entry>static</entry>
	      <entry><option>-fno-liberate-case-threshold</option></entry>
	    </row>

	    <row>
	      <entry><option>-fomit-interface-pragmas</option></entry>
	      <entry>Don't generate interface pragmas</entry>
990
	      <entry>dynamic</entry>
991 992 993
	      <entry><option>-fno-omit-interface-pragmas</option></entry>
	    </row>

chak's avatar
chak committed
994 995 996 997 998 999 1000 1001
	    <row>
	      <entry><option>-fmax-worker-args</option></entry>
	      <entry>If a worker has that many arguments, none will be
	        unpacked anymore (default: 10)</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

1002 1003 1004
	    <row>
	      <entry><option>-fmax-simplifier-iterations</option></entry>
	      <entry>Set the max iterations for the simplifier</entry>
1005
	      <entry>dynamic</entry>
1006 1007 1008
	      <entry>-</entry>
	    </row>

1009 1010 1011 1012 1013 1014 1015 1016
	    <row>
	      <entry><option>-fno-state-hack</option></entry>
	      <entry>Turn off the "state hack" whereby any lambda with a real-world state token
	      as argument is considered to be single-entry.  Hence OK to inline things inside it.</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

1017 1018 1019
	    <row>
	      <entry><option>-fno-cse</option></entry>
	      <entry>Turn off common sub-expression</entry>
1020
	      <entry>dynamic</entry>
1021 1022 1023
	      <entry>-</entry>
	    </row>

1024 1025
	    <row>
	      <entry><option>-fno-full-laziness</option></entry>
1026
	      <entry>Turn off full laziness (floating bindings outwards).</entry>
1027
	      <entry>dynamic</entry>
1028
	      <entry>-ffull-laziness</entry>
1029 1030
	    </row>

1031 1032 1033 1034 1035 1036 1037 1038 1039 1040
	    <row>
	      <entry><option>-fno-pre-inlining</option></entry>
	      <entry>Turn off pre-inlining</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>

	    <row>
	      <entry><option>-fno-strictness</option></entry>
	      <entry>Turn off strictness analysis</entry>
1041
	      <entry>dynamic</entry>
1042 1043 1044 1045 1046 1047
	      <entry>-</entry>
	    </row>

	    <row>
	      <entry><option>-funbox-strict-fields</option></entry>
	      <entry>Flatten strict constructor fields</entry>
1048
	      <entry>dynamic</entry>
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
	      <entry><option>-fno-unbox-strict-fields</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-creation-threshold</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-creation-threshold</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-fun-discount</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-fun-discount</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-keeness-factor</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-keeness-factor</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-update-in-place</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-update-in-place</option></entry>
	    </row>

	    <row>
	      <entry><option>-funfolding-use-threshold</option></entry>
	      <entry>Tweak unfolding settings</entry>
	      <entry>static</entry>
	      <entry><option>-fno-unfolding-use-threshold</option></entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
1092 1093 1094
      <title>Profiling options</title>
      
      <para><xref linkend="profiling"/></para>
1095 1096

      <informaltable>
1097
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-auto</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all
	      exported functions</entry>
	      <entry>static</entry>
	      <entry><option>-no-auto</option></entry>
	    </row>
	    <row>
	      <entry><option>-auto-all</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all
	      top-level functions</entry>
	      <entry>static</entry>
	      <entry><option>-no-auto-all</option></entry>
	    </row>
	    <row>
	      <entry><option>-caf-all</option></entry>
	      <entry>Auto-add <literal>_scc_</literal>s to all CAFs</entry>
	      <entry>static</entry>
	      <entry><option>-no-caf-all</option></entry>
	    </row>
	    <row>
	      <entry><option>-prof</option></entry>
	      <entry>Turn on profiling</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ticky</option></entry>
	      <entry>Turn on ticky-ticky profiling</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

Ian Lynagh's avatar
Ian Lynagh committed
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
    <sect2>
      <title>Haskell pre-processor options</title>

      <para><xref linkend="pre-processor"/></para>

      <informaltable>
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-F</option></entry>
	      <entry>
                  Enable the use of a pre-processor
                  (set with <option>-pgmF</option>)
              </entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

1174
    <sect2>
1175 1176 1177
      <title>C pre-processor options</title>

      <para><xref linkend="c-pre-processor"/></para>
1178 1179

      <informaltable>
1180
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
1181 1182 1183 1184 1185 1186 1187 1188 1189
	  <thead>
	    <row>