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

dterei's avatar
dterei committed
5
  <para>This section is a quick-reference for GHC's command-line
6
    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>

dterei's avatar
dterei committed
10
  <sect2>
11
    <title>Verbosity options</title>
12

Simon Peyton Jones's avatar
Simon Peyton Jones committed
13 14
    <para>More details in <xref linkend="options-help"/></para>

15
    <informaltable>
16
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
dterei's avatar
dterei committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
        <thead>
          <row>
            <entry>Flag</entry>
            <entry>Description</entry>
            <entry>Static/Dynamic</entry>
            <entry>Reverse</entry>
          </row>
        </thead>
        <tbody>
          <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>
          <row>
39
            <entry><option>-fprint-explicit-foralls</option></entry>
40
            <entry>Print explicit <literal>forall</literal> quantification in types. See also <option>-XExplicitForAll</option></entry>
41 42
            <entry>dynamic</entry>
            <entry>-fno-print-explicit-foralls</entry>
dterei's avatar
dterei committed
43 44
          </row>
          <row>
45
            <entry><option>-fprint-explicit-kinds</option></entry>
46
            <entry>Print explicit kind foralls and kind arguments in types. See also <option>-XKindSignature</option></entry>
47 48
            <entry>dynamic</entry>
            <entry>-fno-print-explicit-kinds</entry>
dterei's avatar
dterei committed
49
          </row>
50 51 52 53 54 55
          <row>
            <entry><option>-fprint-unicode-syntax</option></entry>
            <entry>Use unicode syntax when printing expressions, types and kinds. See also <option>-XUnicodeSyntax</option></entry>
            <entry>dynamic</entry>
            <entry>-fno-print-unicode-syntax</entry>
          </row>
56 57 58 59 60 61
          <row>
            <entry><option>-fprint-expanded-synonyms</option></entry>
            <entry>In type errors, also print type-synonym-expanded types.</entry>
            <entry>dynamic</entry>
            <entry>-fno-print-expanded-synonyms</entry>
          </row>
dterei's avatar
dterei committed
62 63 64
          <row>
            <entry><option>-ferror-spans</option></entry>
            <entry>output full span in error messages</entry>
65
            <entry>dynamic</entry>
dterei's avatar
dterei committed
66 67 68 69 70
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-H</option><replaceable>size</replaceable></entry>
            <entry>Set the minimum heap size to <replaceable>size</replaceable></entry>
71
            <entry>dynamic</entry>
dterei's avatar
dterei committed
72 73 74 75 76
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-Rghc-timing</option></entry>
            <entry>Summarise timing stats for GHC (same as <literal>+RTS -tstderr</literal>)</entry>
77
            <entry>dynamic</entry>
dterei's avatar
dterei committed
78 79 80 81 82
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
83

dterei's avatar
dterei committed
84 85
  </sect2>
  <sect2>
86
    <title>Alternative modes of operation</title>
dterei's avatar
dterei committed
87

Simon Peyton Jones's avatar
Simon Peyton Jones committed
88
    <para>More details in <xref linkend="modes"/></para>
dterei's avatar
dterei committed
89 90 91 92

    <informaltable>
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
        <thead>
93
          <row>
dterei's avatar
dterei committed
94 95 96 97 98 99 100 101
            <entry>Flag</entry>
            <entry>Description</entry>
            <entry>Static/Dynamic</entry>
            <entry>Reverse</entry>
          </row>
        </thead>
        <tbody>
          <row>
102
            <entry><option>--help</option>,<option>-?</option></entry>
103
            <entry>Display help</entry>
dterei's avatar
dterei committed
104 105 106
            <entry>mode</entry>
            <entry>-</entry>
          </row>
107

dterei's avatar
dterei committed
108
          <row>
109 110 111
            <entry><option>--interactive</option></entry>
            <entry>Interactive mode - normally used by just running <command>ghci</command>;
              see <xref linkend="ghci"/> for details.</entry>
dterei's avatar
dterei committed
112 113 114 115
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
116 117 118
            <entry><option>--make</option></entry>
            <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>
dterei's avatar
dterei committed
119 120 121 122
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
123 124 125 126
            <entry><option>-e <replaceable>expr</replaceable></option></entry>
            <entry>Evaluate <replaceable>expr</replaceable>;
              see <xref linkend="eval-mode"/> for details.</entry>
            <entry>mode</entry>
dterei's avatar
dterei committed
127 128
            <entry>-</entry>
          </row>
129

dterei's avatar
dterei committed
130
          <row>
131 132 133
            <entry><option>--show-iface</option></entry>
            <entry>Display the contents of an interface file.</entry>
            <entry>mode</entry>
dterei's avatar
dterei committed
134
            <entry>-</entry>
135
          </row>
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182

          <row>
            <entry><option>-M</option></entry>
            <entry>Generate dependency information suitable for use in a <filename>Makefile</filename>;
              see <xref linkend="makefile-dependencies"/> for details.</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>


          <row>
            <entry><option>--supported-extensions</option>, <option>--supported-languages</option></entry>
            <entry>display the supported language extensions</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--show-options</option></entry>
            <entry>display the supported command line options</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--info</option></entry>
            <entry>display information about the compiler</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--version, -V</option></entry>
            <entry>display GHC version</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--numeric-version</option></entry>
            <entry>display GHC version (numeric only)</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--print-libdir</option></entry>
            <entry>display GHC library directory</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>

dterei's avatar
dterei committed
183 184 185 186 187 188
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
189
    <title>Which phases to run</title>
190

191
    <para><xref linkend="options-order"/></para>
dterei's avatar
dterei committed
192 193 194 195

    <informaltable>
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
        <thead>
196
          <row>
dterei's avatar
dterei committed
197 198 199 200 201 202 203 204
            <entry>Flag</entry>
            <entry>Description</entry>
            <entry>Static/Dynamic</entry>
            <entry>Reverse</entry>
          </row>
        </thead>
        <tbody>
          <row>
205 206
            <entry><option>-E</option></entry>
            <entry>Stop after preprocessing (<literal>.hspp</literal> file)</entry>
dterei's avatar
dterei committed
207 208 209 210
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
211 212
            <entry><option>-C</option></entry>
            <entry>Stop after generating C (<literal>.hc</literal> file)</entry>
dterei's avatar
dterei committed
213 214 215 216
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
217 218
            <entry><option>-S</option></entry>
            <entry>Stop after generating assembly (<literal>.s</literal> file)</entry>
dterei's avatar
dterei committed
219 220 221 222
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
223
            <entry><option>-c</option></entry>
224 225
            <entry>Stop after generating object (<literal>.o</literal>) file</entry>
            <entry>mode</entry>
226 227 228 229 230
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-x</option> <replaceable>suffix</replaceable></entry>
            <entry>Override default behaviour for source files</entry>
231
            <entry>dynamic</entry>
dterei's avatar
dterei committed
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Redirecting output</title>

    <para><xref linkend="options-output"/></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>-hcsuf</option> <replaceable>suffix</replaceable></entry>
            <entry>set the suffix to use for intermediate C files</entry>
258
            <entry>dynamic</entry>
dterei's avatar
dterei committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hidir</option> <replaceable>dir</replaceable></entry>
            <entry>set directory for interface files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hisuf</option> <replaceable>suffix</replaceable></entry>
            <entry>set the suffix to use for interface files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-o</option> <replaceable>filename</replaceable></entry>
            <entry>set output filename</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
            <entry>set directory for object files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-ohi</option> <replaceable>filename</replaceable></entry>
            <entry>set the filename in which to put the interface</entry>
            <entry>dynamic</entry>
            <entry></entry>
          </row>
          <row>
            <entry><option>-osuf</option> <replaceable>suffix</replaceable></entry>
            <entry>set the output file suffix</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-stubdir</option> <replaceable>dir</replaceable></entry>
            <entry>redirect FFI stub files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-dumpdir</option> <replaceable>dir</replaceable></entry>
            <entry>redirect dump files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-outputdir</option> <replaceable>dir</replaceable></entry>
            <entry>set output directory</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
314
          </row>
dterei's avatar
dterei committed
315 316 317 318
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>
319

dterei's avatar
dterei committed
320 321
  <sect2>
    <title>Keeping intermediate files</title>
322

dterei's avatar
dterei committed
323
    <para><xref linkend="keeping-intermediates"/></para>
324

dterei's avatar
dterei committed
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
    <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>-keep-hc-file</option> or
              <option>-keep-hc-files</option></entry>
            <entry>retain intermediate <literal>.hc</literal> files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-keep-llvm-file</option> or
              <option>-keep-llvm-files</option></entry>
            <entry>retain intermediate LLVM <literal>.ll</literal> files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-keep-s-file</option> or
              <option>-keep-s-files</option></entry>
            <entry>retain intermediate <literal>.s</literal> files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-keep-tmp-files</option></entry>
            <entry>retain all intermediate temporary files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Temporary files</title>

    <para><xref linkend="temp-files"/></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>-tmpdir</option></entry>
            <entry>set the directory for temporary files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Finding imports</title>

    <para><xref linkend="search-path"/></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>-i</option><replaceable>dir1</replaceable>:<replaceable>dir2</replaceable>:...</entry>
            <entry>add <replaceable>dir</replaceable>,
              <replaceable>dir2</replaceable>, etc. to import path</entry>
416
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
417 418 419 420 421
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-i</option></entry>
            <entry>Empty the import directory list</entry>
422
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Interface file options</title>

    <para><xref linkend="hi-options"/></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>-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>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-ddump-minimal-imports</option></entry>
            <entry>Dump a minimal set of imports</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>--show-iface</option> <replaceable>file</replaceable></entry>
            <entry>See <xref linkend="modes"/>.</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Recompilation checking</title>

    <para><xref linkend="recomp"/></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>-fforce-recomp</option></entry>
493 494 495
            <entry>Turn off recompilation checking. This is implied by any
              <option>-ddump-X</option> option when compiling a single
              file (i.e. when using <literal>-c</literal>).</entry>
dterei's avatar
dterei committed
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522
            <entry>dynamic</entry>
            <entry><option>-fno-force-recomp</option></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2 id="interactive-mode-options">
    <title>Interactive-mode options</title>

    <para><xref linkend="ghci-dot-files"/></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>-ignore-dot-ghci</option></entry>
            <entry>Disable reading of <filename>.ghci</filename> files</entry>
523
            <entry>dynamic</entry>
dterei's avatar
dterei committed
524 525
            <entry>-</entry>
          </row>
526 527 528 529 530 531
          <row>
            <entry><option>-ghci-script</option></entry>
            <entry>Read additional <filename>.ghci</filename> files</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
dterei's avatar
dterei committed
532 533 534 535 536 537
          <row>
            <entry><option>-fbreak-on-error</option></entry>
            <entry><link linkend="ghci-debugger-exceptions">Break on uncaught exceptions and errors</link></entry>
            <entry>dynamic</entry>
            <entry><option>-fno-break-on-error</option></entry>
          </row>
538 539 540 541 542 543
          <row>
            <entry><option>-fbreak-on-exception</option></entry>
            <entry><link linkend="ghci-debugger-exceptions">Break on any exception thrown</link></entry>
            <entry>dynamic</entry>
            <entry><option>-fno-break-on-exception</option></entry>
          </row>
dterei's avatar
dterei committed
544
          <row>
545 546 547 548 549 550
            <entry><option>-fghci-hist-size=<replaceable>n</replaceable></option></entry>
            <entry><link linkend="ghci-debugger">Set the number of entries GHCi keeps for <literal>:history</literal></link></entry>
            <entry>dynamic</entry>
            <entry><option>(default is 50)</option></entry>
          </row>
          <row>
dterei's avatar
dterei committed
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572
            <entry><option>-fprint-evld-with-show</option></entry>
            <entry><link linkend="breakpoints">Enable usage of Show instances in <literal>:print</literal></link></entry>
            <entry>dynamic</entry>
            <entry><option>-fno-print-evld-with-show</option></entry>
          </row>
          <row>
            <entry><option>-fprint-bind-result</option></entry>
            <entry><link linkend="ghci-stmts">Turn on printing of binding results in GHCi</link></entry>
            <entry>dynamic</entry>
            <entry><option>-fno-print-bind-result</option></entry>
          </row>
          <row>
            <entry><option>-fno-print-bind-contents</option></entry>
            <entry><link linkend="breakpoints">Turn off printing of binding contents in GHCi</link></entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-fno-implicit-import-qualified</option></entry>
            <entry><link linkend="ghci-import-qualified">Turn off
                implicit qualified import of everything in GHCi</link></entry>
            <entry>dynamic</entry>
573 574 575 576 577 578 579
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-interactive-print</option></entry>
            <entry><link linkend="ghci-interactive-print">Select the function
                    to use for printing evaluated expressions in GHCi</link></entry>
            <entry>dynamic</entry>
dterei's avatar
dterei committed
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
            <entry>-</entry>
          </row>

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

  <sect2>
    <title>Packages</title>

    <para><xref linkend="packages"/></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>
605
            <entry><option>-this-package-key</option> <replaceable>P</replaceable></entry>
dterei's avatar
dterei committed
606
            <entry>Compile to be part of package <replaceable>P</replaceable></entry>
607
            <entry>dynamic</entry>
dterei's avatar
dterei committed
608 609 610 611 612
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-package</option> <replaceable>P</replaceable></entry>
            <entry>Expose package <replaceable>P</replaceable></entry>
613
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
614 615 616 617 618
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hide-all-packages</option></entry>
            <entry>Hide all packages by default</entry>
619
            <entry>dynamic</entry>
dterei's avatar
dterei committed
620 621 622 623 624
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hide-package</option> <replaceable>name</replaceable></entry>
            <entry>Hide package <replaceable>P</replaceable></entry>
625
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
626 627 628 629 630
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-ignore-package</option> <replaceable>name</replaceable></entry>
            <entry>Ignore package <replaceable>P</replaceable></entry>
631
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
632 633 634
            <entry>-</entry>
          </row>
          <row>
635 636
            <entry><option>-package-db</option> <replaceable>file</replaceable></entry>
            <entry>Add <replaceable>file</replaceable> to the package db stack.</entry>
637
            <entry>dynamic</entry>
dterei's avatar
dterei committed
638 639 640
            <entry>-</entry>
          </row>
          <row>
641
            <entry><option>-clear-package-db</option></entry>
642
            <entry>Clear the package db stack.</entry>
643
            <entry>dynamic</entry>
644 645 646 647
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-global-package-db</option></entry>
648
            <entry>Remove the global package db from the stack.</entry>
649
            <entry>dynamic</entry>
650 651 652 653 654
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-global-package-db</option></entry>
            <entry>Add the global package db to the stack.</entry>
655
            <entry>dynamic</entry>
656 657 658 659
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-user-package-db</option></entry>
660
            <entry>Remove the user's package db from the stack.</entry>
661
            <entry>dynamic</entry>
662 663 664 665 666
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-user-package-db</option></entry>
            <entry>Add the user's package db to the stack.</entry>
667
            <entry>dynamic</entry>
dterei's avatar
dterei committed
668 669 670 671
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-auto-link-packages</option></entry>
672
            <entry>Don't automatically link in the base and rts packages.</entry>
dterei's avatar
dterei committed
673 674 675 676 677 678 679
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-trust</option> <replaceable>P</replaceable></entry>
            <entry>Expose package <replaceable>P</replaceable> and set it to be
              trusted</entry>
680
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
681 682 683 684 685 686
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-distrust</option> <replaceable>P</replaceable></entry>
            <entry>Expose package <replaceable>P</replaceable> and set it to be
              distrusted</entry>
687
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
688 689 690 691 692
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-distrust-all</option> </entry>
            <entry>Distrust all packages by default</entry>
693
            <entry>dynamic/<literal>:set</literal></entry>
dterei's avatar
dterei committed
694 695 696 697 698 699 700 701 702 703 704 705
            <entry>-</entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Language options</title>

    <para>Language options can be enabled either by a command-line option
      <option>-Xblah</option>, or by a <literal>{-# LANGUAGE blah #-}</literal>
706 707
      pragma in the file itself.  See <xref linkend="options-language"/>. Some
      options are enabled using <option>-f*</option> flags.</para>
dterei's avatar
dterei committed
708 709

    <informaltable>
710
      <tgroup cols="5" align="left" colsep="1" rowsep="1">
dterei's avatar
dterei committed
711 712 713 714 715 716
        <thead>
          <row>
            <entry>Flag</entry>
            <entry>Description</entry>
            <entry>Static/Dynamic</entry>
            <entry>Reverse</entry>
717
            <entry>Since</entry>
dterei's avatar
dterei committed
718 719 720
          </row>
        </thead>
        <tbody>
721 722 723 724 725 726 727 728 729
          <row>
            <entry><option>-fconstraint-solver-iterations=</option><replaceable>n</replaceable></entry>
	    <entry>Set the iteration limit for the type-constraint solver. 
                   The default limit is 4. Typically one iteration
                   suffices; so please yell if you find you need to set
                   it higher than the default. Zero means infinity. </entry>
	    <entry>dynamic</entry>
	    <entry></entry>
	  </row>
730
          <row>
731
            <entry><option>-freduction-depth=</option><replaceable>n</replaceable></entry>
732 733
	    <entry>Set the <link linkend="undecidable-instances">limit for type simplification</link>. 
                   Default is 200; zero means infinity.</entry>
734 735 736 737
	    <entry>dynamic</entry>
	    <entry></entry>
	  </row>
	  <row>
738
            <entry><option>-fcontext-stack=</option><replaceable>n</replaceable></entry>
739
            <entry>Deprecated. Use <option>-freduction-depth=</option><replaceable>n</replaceable> instead.</entry>
740 741
            <entry>dynamic</entry>
            <entry></entry>
742
            <entry></entry>
743
          </row>
dterei's avatar
dterei committed
744 745
          <row>
            <entry><option>-fglasgow-exts</option></entry>
746
            <entry>Deprecated. Enable most language extensions; see <xref linkend="options-language"/> for exactly which ones.</entry>
dterei's avatar
dterei committed
747 748
            <entry>dynamic</entry>
            <entry><option>-fno-glasgow-exts</option></entry>
749
            <entry></entry>
dterei's avatar
dterei committed
750 751
          </row>
          <row>
752 753
            <entry><option>-firrefutable-tuples</option></entry>
            <entry>Make tuple pattern matching irrefutable</entry>
dterei's avatar
dterei committed
754
            <entry>dynamic</entry>
755
            <entry><option>-fno-irrefutable-tuples</option></entry>
756
            <entry></entry>
dterei's avatar
dterei committed
757 758
          </row>
          <row>
759 760
            <entry><option>-fpackage-trust</option></entry>
            <entry>Enable <link linkend="safe-haskell">Safe Haskell</link> trusted package requirement for trustworthy modules.</entry>
dterei's avatar
dterei committed
761
            <entry>dynamic</entry>
762
            <entry><option>-</option></entry>
763
            <entry></entry>
dterei's avatar
dterei committed
764
          </row>
765
          <row>
766
            <entry><option>-ftype-function-depth=</option><replaceable>n</replaceable></entry>
767
            <entry>Deprecated. Use <option>-freduction-depth=</option><replaceable>n</replaceable> instead.</entry>
768 769
            <entry>dynamic</entry>
            <entry></entry>
770
            <entry></entry>
771
          </row>
772 773
          <row>
            <entry><option>-XAllowAmbiguousTypes</option></entry>
774
            <entry>Allow the user to write <link linkend="ambiguity">ambiguous types</link>,
775 776 777 778
                   and the type inference engine to infer them.
                </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoAllowAmbiguousTypes</option></entry>
779
            <entry>7.8.1</entry>
780
          </row>
dterei's avatar
dterei committed
781 782 783 784 785 786
          <row>
            <entry><option>-XArrows</option></entry>
            <entry>Enable <link linkend="arrow-notation">arrow
                notation</link> extension</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoArrows</option></entry>
787
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
788
          </row>
789 790
          <row>
            <entry><option>-XAutoDeriveTypeable</option></entry>
791 792
            <entry>As of GHC 7.10, this option is not needed, and should
                   not be used.  Automatically <link linkend="deriving-typeable">derive Typeable instances for every datatype and type class declaration</link>.
793 794 795
            Implies <option>-XDeriveDataTypeable</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoAutoDeriveTypeable</option></entry>
796
            <entry>7.8.1</entry>
797
          </row>
798 799 800 801 802
          <row>
            <entry><option>-XBangPatterns</option></entry>
            <entry>Enable <link linkend="bang-patterns">bang patterns</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoBangPatterns</option></entry>
803
            <entry>6.8.1</entry>
804
          </row>
805 806 807 808 809
          <row>
            <entry><option>-XBinaryLiterals</option></entry>
            <entry>Enable support for <link linkend="binary-literals">binary literals</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoBinaryLiterals</option></entry>
810
            <entry>7.10.1</entry>
811
          </row>
812 813 814 815 816
          <row>
            <entry><option>-XCApiFFI</option></entry>
            <entry>Enable <link linkend="ffi-capi">the CAPI calling convention</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoCAPIFFI</option></entry>
817
            <entry>7.10.1</entry>
818 819 820 821 822 823
          </row>
          <row>
            <entry><option>-XConstrainedClassMethods</option></entry>
            <entry>Enable <link linkend="class-method-types">constrained class methods</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoConstrainedClassMethods</option></entry>
824
            <entry>6.8.1</entry>
825
          </row>
826 827 828 829 830
          <row>
            <entry><option>-XConstraintKinds</option></entry>
            <entry>Enable a <link linkend="constraint-kind">kind of constraints</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoConstraintKinds</option></entry>
831
            <entry>7.4.1</entry>
832
          </row>
833 834 835 836 837
          <row>
            <entry><option>-XCPP</option></entry>
            <entry>Enable the <link linkend="c-pre-processor">C preprocessor</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoCPP</option></entry>
838
            <entry>6.8.1</entry>
839
          </row>
840 841 842 843 844
          <row>
            <entry><option>-XDataKinds</option></entry>
            <entry>Enable <link linkend="promotion">datatype promotion</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDataKinds</option></entry>
845
            <entry>7.4.1</entry>
846
          </row>
847 848 849 850 851
          <row>
            <entry><option>-XDefaultSignatures</option></entry>
            <entry>Enable <link linkend="class-default-signatures">default signatures</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDefaultSignatures</option></entry>
852
            <entry>7.2.1</entry>
853
          </row>
854 855 856 857 858 859
          <row>
            <entry><option>-XDeriveAnyClass</option></entry>
            <entry>Enable <link linkend="derive-any-class">deriving for any
                   class</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveAnyClass</option></entry>
860
            <entry>7.10.1</entry>
861
          </row>
862 863
          <row>
            <entry><option>-XDeriveDataTypeable</option></entry>
864
            <entry>Enable <link linkend="deriving-typeable">deriving for the Data class</link>.
865
              Implied by <option>-XAutoDeriveTypeable</option>.</entry>
866 867
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveDataTypeable</option></entry>
868
            <entry>6.8.1</entry>
869
          </row>
870 871 872 873 874 875
          <row>
            <entry><option>-XDeriveFunctor</option></entry>
            <entry>Enable <link linkend="deriving-extra">deriving for the Functor class</link>.
              Implied by <option>-XDeriveTraversable</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveFunctor</option></entry>
876
            <entry>7.10.1</entry>
877 878 879 880 881 882 883
          </row>
          <row>
            <entry><option>-XDeriveFoldable</option></entry>
            <entry>Enable <link linkend="deriving-extra">deriving for the Foldable class</link>.
              Implied by <option>-XDeriveTraversable</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveFoldable</option></entry>
884
            <entry>7.10.1</entry>
885
          </row>
886 887 888 889 890
          <row>
            <entry><option>-XDeriveGeneric</option></entry>
            <entry>Enable <link linkend="deriving-typeable">deriving for the Generic class</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveGeneric</option></entry>
891
            <entry>7.2.1</entry>
892 893
          </row>
          <row>
894 895 896
            <entry><option>-XDeriveTraversable</option></entry>
            <entry>Enable <link linkend="deriving-extra">deriving for the Traversable class</link>.
              Implies <option>-XDeriveFunctor</option> and <option>-XDeriveFoldable</option>.</entry>
897
            <entry>dynamic</entry>
898
            <entry><option>-XNoDeriveTraversable</option></entry>
899
            <entry>7.10.1</entry>
900
          </row>
dterei's avatar
dterei committed
901 902
          <row>
            <entry><option>-XDisambiguateRecordFields</option></entry>
903 904
            <entry>Enable <link linkend="disambiguate-fields">record field disambiguation</link>.
              Implied by <option>-XRecordWildCards</option>.</entry>
dterei's avatar
dterei committed
905 906
            <entry>dynamic</entry>
            <entry><option>-XNoDisambiguateRecordFields</option></entry>
907
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
908
          </row>
909 910
          <row>
            <entry><option>-XEmptyCase</option></entry>
911
            <entry>Allow <link linkend="empty-case">empty case alternatives</link>.</entry>
912 913
            <entry>dynamic</entry>
            <entry><option>-XNoEmptyCase</option></entry>
914
            <entry>7.8.1</entry>
915
          </row>
916 917 918 919 920
          <row>
            <entry><option>-XEmptyDataDecls</option></entry>
            <entry>Enable empty data declarations.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoEmptyDataDecls</option></entry>
921
            <entry>6.8.1</entry>
922 923 924 925 926 927
          </row>
          <row>
            <entry><option>-XExistentialQuantification</option></entry>
            <entry>Enable <link linkend="existential-quantification">existential quantification</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoExistentialQuantification</option></entry>
928
            <entry>6.8.1</entry>
929 930 931 932 933 934
          </row>
          <row>
            <entry><option>-XExplicitForAll</option></entry>
            <entry>Enable <link linkend="explicit-foralls">explicit universal quantification</link>.
              Implied by <option>-XScopedTypeVariables</option>,
              <option>-XLiberalTypeSynonyms</option>,
935
              <option>-XRankNTypes</option> and
936 937 938 939
              <option>-XExistentialQuantification</option>.
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoExplicitForAll</option></entry>
940
            <entry>6.12.1</entry>
941 942 943 944 945 946 947 948
          </row>
          <row>
            <entry><option>-XExplicitNamespaces</option></entry>
            <entry>Enable using the keyword <literal>type</literal> to specify the namespace of
                   entries in imports and exports (<xref linkend="explicit-namespaces"/>).
                   Implied by <option>-XTypeOperators</option> and <option>-XTypeFamilies</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoExplicitNamespaces</option></entry>
949
            <entry>7.6.1</entry>
950
          </row>
951 952
          <row>
            <entry><option>-XExtendedDefaultRules</option></entry>
953
            <entry>Use GHCi's <link linkend="extended-default-rules">extended default rules</link> in a normal module.</entry>
954 955
            <entry>dynamic</entry>
            <entry><option>-XNoExtendedDefaultRules</option></entry>
956
            <entry>6.8.1</entry>
957
          </row>
958 959
          <row>
            <entry><option>-XFlexibleContexts</option></entry>
960 961
            <entry>Enable <link linkend="flexible-contexts">flexible contexts</link>.
              Implied by <option>-XImplicitParams</option>.</entry>
962 963
            <entry>dynamic</entry>
            <entry><option>-XNoFlexibleContexts</option></entry>
964
            <entry>6.8.1</entry>
965 966 967 968
          </row>
          <row>
            <entry><option>-XFlexibleInstances</option></entry>
            <entry>Enable <link linkend="instance-rules">flexible instances</link>.
969
              Implies <option>-XTypeSynonymInstances</option>. Implied by <option>-XImplicitParams</option>.</entry>
970 971
            <entry>dynamic</entry>
            <entry><option>-XNoFlexibleInstances</option></entry>
972
            <entry>6.8.1</entry>
973
          </row>
dterei's avatar
dterei committed
974 975
          <row>
            <entry><option>-XForeignFunctionInterface</option></entry>
976
            <entry>Enable <link linkend="ffi">foreign function interface</link>.</entry>
dterei's avatar
dterei committed
977 978
            <entry>dynamic</entry>
            <entry><option>-XNoForeignFunctionInterface</option></entry>
979
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
980
          </row>
981 982
          <row>
            <entry><option>-XFunctionalDependencies</option></entry>
983 984
            <entry>Enable <link linkend="functional-dependencies">functional dependencies</link>.
              Implies <option>-XMultiParamTypeClasses</option>.</entry>
985 986
            <entry>dynamic</entry>
            <entry><option>-XNoFunctionalDependencies</option></entry>
987
            <entry>6.8.1</entry>
988
          </row>
989 990 991
          <row>
            <entry><option>-XGADTs</option></entry>
            <entry>Enable <link linkend="gadt">generalised algebraic data types</link>.
992
              Implies <option>-XGADTSyntax</option> and <option>-XMonoLocalBinds</option>.</entry>
993 994
            <entry>dynamic</entry>
            <entry><option>-XNoGADTs</option></entry>
995
            <entry>6.8.1</entry>
996 997 998 999 1000 1001 1002
          </row>
          <row>
            <entry><option>-XGADTSyntax</option></entry>
            <entry>Enable <link linkend="gadt-style">generalised algebraic data type syntax</link>.
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoGADTSyntax</option></entry>
1003
            <entry>7.2.1</entry>
1004
          </row>
1005 1006 1007 1008 1009
          <row>
            <entry><option>-XGeneralizedNewtypeDeriving</option></entry>
            <entry>Enable <link linkend="newtype-deriving">newtype deriving</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoGeneralizedNewtypeDeriving</option></entry>
1010
            <entry>6.8.1</entry>
1011
          </row>
dterei's avatar
dterei committed
1012 1013 1014 1015 1016 1017 1018
          <row>
            <entry><option>-XGenerics</option></entry>
            <entry>Deprecated, does nothing. No longer enables <link linkend="generic-classes">generic classes</link>.
              See also GHC's support for
              <link linkend="generic-programming">generic programming</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoGenerics</option></entry>
1019
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
1020 1021 1022
          </row>
          <row>
            <entry><option>-XImplicitParams</option></entry>
1023 1024
            <entry>Enable <link linkend="implicit-parameters">Implicit Parameters</link>.
              Implies <option>-XFlexibleContexts</option> and <option>-XFlexibleInstances</option>.</entry>
dterei's avatar
dterei committed
1025 1026
            <entry>dynamic</entry>
            <entry><option>-XNoImplicitParams</option></entry>
1027
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
1028 1029 1030
          </row>
          <row>
            <entry><option>-XNoImplicitPrelude</option></entry>
1031 1032
            <entry>Don't implicitly <literal>import Prelude</literal>.
              Implied by <option>-XRebindableSyntax</option>.</entry>
dterei's avatar
dterei committed
1033 1034
            <entry>dynamic</entry>
            <entry><option>-XImplicitPrelude</option></entry>
1035
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
1036
          </row>
1037 1038
          <row>
            <entry><option>-XImpredicativeTypes</option></entry>
1039 1040
            <entry>Enable <link linkend="impredicative-polymorphism">impredicative types</link>.
              Implies <option>-XRankNTypes</option>.</entry>
1041 1042
            <entry>dynamic</entry>
            <entry><option>-XNoImpredicativeTypes</option></entry>
1043
            <entry>6.10.1</entry>
1044
          </row>
dterei's avatar
dterei committed
1045
          <row>
1046 1047
            <entry><option>-XIncoherentInstances</option></entry>
            <entry>Enable <link linkend="instance-overlap">incoherent instances</link>.
1048
              Implies <option>-XOverlappingInstances</option>.</entry>
dterei's avatar
dterei committed
1049
            <entry>dynamic</entry>
1050
            <entry><option>-XNoIncoherentInstances</option></entry>
1051
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
1052 1053
          </row>
          <row>
1054 1055
            <entry><option>-XInstanceSigs</option></entry>
            <entry>Enable <link linkend="instance-sigs">instance signatures</link>.</entry>
dterei's avatar
dterei committed
1056
            <entry>dynamic</entry>
1057
            <entry><option>-XNoInstanceSigs</option></entry>
1058
            <entry>7.10.1</entry>
dterei's avatar
dterei committed
1059 1060
          </row>
          <row>
1061 1062
            <entry><option>-XInterruptibleFFI</option></entry>
            <entry>Enable interruptible FFI.</entry>
1063
            <entry>dynamic</entry>
1064
            <entry><option>-XNoInterruptibleFFI</option></entry>
1065
            <entry>7.2.1</entry>
1066
          </row>
dterei's avatar
dterei committed
1067
          <row>
1068
            <entry><option>-XKindSignatures</option></entry>
1069 1070
            <entry>Enable <link linkend="kinding">kind signatures</link>.
              Implied by <option>-XTypeFamilies</option> and <option>-XPolyKinds</option>.</entry>
dterei's avatar
dterei committed
1071
            <entry>dynamic</entry>
1072
            <entry><option>-XNoKindSignatures</option></entry>
1073
            <entry>6.8.1</entry>
dterei's avatar
dterei committed
1074 1075
          </row>
          <row>
1076 1077
            <entry><option>-XLambdaCase</option></entry>
            <entry>Enable <link linkend="lambda-case">lambda-case expressions</link>.</entry>
dterei's avatar
dterei committed
1078
            <entry>dynamic</entry>
1079
            <entry><option>-XNoLambdaCase</option></entry>
1080
            <entry>7.6.1</entry>
dterei's avatar
dterei committed
1081 1082
          </row>
          <row>
1083 1084
            <entry><option>-XLiberalTypeSynonyms</option></entry>
            <entry>Enable <link linkend="type-synonyms">liberalised type synonyms</link>.</entry>
dterei's avatar
dterei committed
1085
            <entry>dynamic</entry>
1086
            <entry><option>-XNoLiberalTypeSynonyms</option></entry>
1087
            <entry>6.8.1</entry>