flags.xml 114 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 11
  <sect2>
    <title>Help and verbosity options</title>
12

dterei's avatar
dterei committed
13
    <para><xref linkend="options-help"/></para>
14

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
        <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>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
33
            <entry><option>--help</option></entry>
dterei's avatar
dterei committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
            <entry>help</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <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>
            <entry><option>-V</option></entry>
            <entry>display GHC version</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
57
            <entry><option>--supported-extensions</option> or <option>--supported-languages</option></entry>
dterei's avatar
dterei committed
58 59 60 61
            <entry>display the supported languages and language extensions</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
62
          <row>
63
            <entry><option>--show-options</option></entry>
64 65 66 67
            <entry>display the supported command line options</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
dterei's avatar
dterei committed
68
          <row>
69
            <entry><option>--info</option></entry>
dterei's avatar
dterei committed
70 71 72 73 74
            <entry>display information about the compiler</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
75
            <entry><option>--version</option></entry>
dterei's avatar
dterei committed
76 77 78 79 80
            <entry>display GHC version</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
81
            <entry><option>--numeric-version</option></entry>
dterei's avatar
dterei committed
82 83 84 85 86
            <entry>display GHC version (numeric only)</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
87
            <entry><option>--print-libdir</option></entry>
dterei's avatar
dterei committed
88 89 90 91 92 93 94
            <entry>display GHC library directory</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-ferror-spans</option></entry>
            <entry>output full span in error messages</entry>
95
            <entry>dynamic</entry>
dterei's avatar
dterei committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
            <entry>-</entry>
          </row>
          <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>
          <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>
        </tbody>
      </tgroup>
    </informaltable>
113

dterei's avatar
dterei committed
114 115 116 117 118 119 120 121 122
  </sect2>
  <sect2>
    <title>Which phases to run</title>

    <para><xref linkend="options-order"/></para>

    <informaltable>
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
        <thead>
123
          <row>
dterei's avatar
dterei committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
            <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>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-C</option></entry>
            <entry>Stop after generating C (<literal>.hc</literal> file)</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-S</option></entry>
            <entry>Stop after generating assembly (<literal>.s</literal> file)</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-c</option></entry>
            <entry>Do not link</entry>
152
            <entry>dynamic</entry>
dterei's avatar
dterei committed
153 154 155 156 157 158 159
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-x</option> <replaceable>suffix</replaceable></entry>
            <entry>Override default behaviour for source files</entry>
            <entry>static</entry>
            <entry>-</entry>
160
          </row>
dterei's avatar
dterei committed
161 162 163 164 165 166 167
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Alternative modes of operation</title>
168

dterei's avatar
dterei committed
169 170 171 172 173
    <para><xref linkend="modes"/></para>

    <informaltable>
      <tgroup cols="4" align="left" colsep="1" rowsep="1">
        <thead>
174
          <row>
dterei's avatar
dterei committed
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
            <entry>Flag</entry>
            <entry>Description</entry>
            <entry>Static/Dynamic</entry>
            <entry>Reverse</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry><option>--interactive</option></entry>
            <entry>Interactive mode - normally used by just running <command>ghci</command>;
              see <xref linkend="ghci"/> for details.</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <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>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-e <replaceable>expr</replaceable></option></entry>
            <entry>Evaluate <replaceable>expr</replaceable>;
              see <xref linkend="eval-mode"/> for details.</entry>
            <entry>mode</entry>
            <entry>-</entry>
          </row>
          <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>
        </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>
234
            <entry>dynamic</entry>
dterei's avatar
dterei committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 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
            <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>
290
          </row>
dterei's avatar
dterei committed
291 292 293 294
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>
295

dterei's avatar
dterei committed
296 297
  <sect2>
    <title>Keeping intermediate files</title>
298

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

dterei's avatar
dterei committed
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 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 416 417 418 419 420 421 422 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
    <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>
            <entry>static/<literal>:set</literal></entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-i</option></entry>
            <entry>Empty the import directory list</entry>
            <entry>static/<literal>:set</literal></entry>
            <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>
469 470 471
            <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
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
            <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>
499
            <entry>dynamic</entry>
dterei's avatar
dterei committed
500 501
            <entry>-</entry>
          </row>
502 503 504 505 506 507
          <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
508 509 510 511 512 513 514 515 516 517 518 519 520
          <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>
          <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>
          <row>
521 522 523 524 525 526
            <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
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
            <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>
549 550 551 552 553 554 555
            <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
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 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 605 606 607 608 609 610
            <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>
            <entry><option>-package-name</option> <replaceable>P</replaceable></entry>
            <entry>Compile to be part of package <replaceable>P</replaceable></entry>
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-package</option> <replaceable>P</replaceable></entry>
            <entry>Expose package <replaceable>P</replaceable></entry>
            <entry>static/<literal>:set</literal></entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hide-all-packages</option></entry>
            <entry>Hide all packages by default</entry>
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-hide-package</option> <replaceable>name</replaceable></entry>
            <entry>Hide package <replaceable>P</replaceable></entry>
            <entry>static/<literal>:set</literal></entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-ignore-package</option> <replaceable>name</replaceable></entry>
            <entry>Ignore package <replaceable>P</replaceable></entry>
            <entry>static/<literal>:set</literal></entry>
            <entry>-</entry>
          </row>
          <row>
611 612
            <entry><option>-package-db</option> <replaceable>file</replaceable></entry>
            <entry>Add <replaceable>file</replaceable> to the package db stack.</entry>
dterei's avatar
dterei committed
613 614 615 616
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
617
            <entry><option>-clear-package-db</option></entry>
618
            <entry>Clear the package db stack.</entry>
619 620 621 622 623
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-global-package-db</option></entry>
624
            <entry>Remove the global package db from the stack.</entry>
625 626 627 628 629 630 631 632 633 634 635
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-global-package-db</option></entry>
            <entry>Add the global package db to the stack.</entry>
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-user-package-db</option></entry>
636
            <entry>Remove the user's package db from the stack.</entry>
637 638 639 640 641 642
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-user-package-db</option></entry>
            <entry>Add the user's package db to the stack.</entry>
dterei's avatar
dterei committed
643 644 645 646 647
            <entry>static</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-no-auto-link-packages</option></entry>
648
            <entry>Don't automatically link in the base and rts packages.</entry>
dterei's avatar
dterei committed
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701
            <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>
            <entry>static/<literal>:set</literal></entry>
            <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>
            <entry>static/<literal>:set</literal></entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-distrust-all</option> </entry>
            <entry>Distrust all packages by default</entry>
            <entry>static/<literal>:set</literal></entry>
            <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>
      pragma in the file itself.  See <xref linkend="options-language"/></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>-fglasgow-exts</option></entry>
            <entry>Enable most language extensions; see <xref linkend="options-language"/> for exactly which ones.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-glasgow-exts</option></entry>
          </row>
          <row>
702 703
            <entry><option>-firrefutable-tuples</option></entry>
            <entry>Make tuple pattern matching irrefutable</entry>
dterei's avatar
dterei committed
704
            <entry>dynamic</entry>
705
            <entry><option>-fno-irrefutable-tuples</option></entry>
dterei's avatar
dterei committed
706 707 708 709 710 711 712
          </row>
          <row>
            <entry><option>-fcontext-stack=N</option><replaceable>n</replaceable></entry>
            <entry>set the <link linkend="undecidable-instances">limit for context reduction</link>. Default is 20.</entry>
            <entry>dynamic</entry>
            <entry></entry>
          </row>
713 714 715 716 717 718 719 720
          <row>
            <entry><option>-XAllowAmbiguousTypes</option></entry>
            <entry>Allow the user to write <link linkend="ambiguity">ambiguous types</link>, 
                   and the type inference engine to infer them.
                </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoAllowAmbiguousTypes</option></entry>
          </row>
dterei's avatar
dterei committed
721 722 723 724 725 726 727
          <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>
          </row>
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764
          <row>
            <entry><option>-XAutoDeriveTypeable</option></entry>
            <entry>Automatically <link linkend="auto-derive-typeable">derive Typeable instances for every datatype and type class declaration</link>.
            Implies <option>-XDeriveDataTypeable</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoAutoDeriveTypeable</option></entry>
          </row>
          <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>
          </row>
          <row>
            <entry><option>-XDataKinds</option></entry>
            <entry>Enable <link linkend="promotion">datatype promotion</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDataKinds</option></entry>
          </row>
          <row>
            <entry><option>-XDeriveDataTypeable</option></entry>
            <entry>Enable <link linkend="deriving-typeable">deriving for the Data and Typeable classes</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDeriveDataTypeable</option></entry>
          </row>
          <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>
          </row>
          <row>
            <entry><option>-XGeneralizedNewtypeDeriving</option></entry>
            <entry>Enable <link linkend="newtype-deriving">newtype deriving</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoGeneralizedNewtypeDeriving</option></entry>
          </row>
dterei's avatar
dterei committed
765 766 767 768 769 770 771
          <row>
            <entry><option>-XDisambiguateRecordFields</option></entry>
            <entry>Enable <link linkend="disambiguate-fields">record
                field disambiguation</link></entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDisambiguateRecordFields</option></entry>
          </row>
772 773 774 775 776 777 778 779 780 781 782 783 784
          <row>
            <entry><option>-XEmptyCase</option></entry>
            <entry>Allow <link linkend="empty-case">empty case alternatives</link>
                  </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoEmptyCase</option></entry>
          </row>
          <row>
            <entry><option>-XExtendedDefaultRules</option></entry>
            <entry>Use GHCi's <link linkend="extended-default-rules">extended default rules</link> in a normal module</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoExtendedDefaultRules</option></entry>
          </row>
dterei's avatar
dterei committed
785 786 787 788 789 790 791
          <row>
            <entry><option>-XForeignFunctionInterface</option></entry>
            <entry>Enable <link linkend="ffi">foreign function interface</link> (implied by
              <option>-fglasgow-exts</option>)</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoForeignFunctionInterface</option></entry>
          </row>
792 793 794 795 796 797 798 799 800 801 802 803 804 805
          <row>
            <entry><option>-XGADTs</option></entry>
            <entry>Enable <link linkend="gadt">generalised algebraic data types</link>.
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoGADTs</option></entry>
          </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>
          </row>
dterei's avatar
dterei committed
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
          <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>
          </row>
          <row>
            <entry><option>-XImplicitParams</option></entry>
            <entry>Enable <link linkend="implicit-parameters">Implicit Parameters</link>.
              Implied by <option>-fglasgow-exts</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoImplicitParams</option></entry>
          </row>
          <row>
            <entry><option>-XNoImplicitPrelude</option></entry>
            <entry>Don't implicitly <literal>import Prelude</literal></entry>
            <entry>dynamic</entry>
            <entry><option>-XImplicitPrelude</option></entry>
          </row>
          <row>
828 829 830
            <entry><option>-XIncoherentInstances</option></entry>
            <entry>Enable <link linkend="instance-overlap">incoherent instances</link>.
              Implies <option>-XOverlappingInstances</option> </entry>
dterei's avatar
dterei committed
831
            <entry>dynamic</entry>
832
            <entry><option>-XNoIncoherentInstances</option></entry>
dterei's avatar
dterei committed
833 834 835 836 837 838 839 840
          </row>
          <row>
            <entry><option>-XNoMonomorphismRestriction</option></entry>
            <entry>Disable the <link linkend="monomorphism">monomorphism restriction</link></entry>
            <entry>dynamic</entry>
            <entry><option>-XMonomorphismRrestriction</option></entry>
          </row>
          <row>
841 842
            <entry><option>-XNegativeLiterals</option></entry>
            <entry>Enable support for <link linkend="negative-literals">negative literals</link></entry>
dterei's avatar
dterei committed
843
            <entry>dynamic</entry>
844
            <entry><option>-XNoNegativeLiterals</option></entry>
dterei's avatar
dterei committed
845
          </row>
846
          <row>
847 848
            <entry><option>-XNoNPlusKPatterns</option></entry>
            <entry>Disable support for <literal>n+k</literal> patterns</entry>
849
            <entry>dynamic</entry>
850
            <entry><option>-XNPlusKPatterns</option></entry>
851
          </row>
thoughtpolice's avatar
thoughtpolice committed
852 853 854 855 856 857
          <row>
            <entry><option>-XNumDecimals</option></entry>
            <entry>Enable support for 'fractional' integer literals</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoNumDecimals</option></entry>
          </row>
dterei's avatar
dterei committed
858
          <row>
859 860
            <entry><option>-XOverlappingInstances</option></entry>
            <entry>Enable <link linkend="instance-overlap">overlapping instances</link></entry>
dterei's avatar
dterei committed
861
            <entry>dynamic</entry>
862
            <entry><option>-XNoOverlappingInstances</option></entry>
dterei's avatar
dterei committed
863 864
          </row>
          <row>
865 866 867
            <entry><option>-XOverloadedLists</option></entry>
            <entry>Enable <link linkend="overloaded-lists">overloaded lists</link>.
            </entry>
dterei's avatar
dterei committed
868
            <entry>dynamic</entry>
869
            <entry><option>-XNoOverloadedLists</option></entry>
dterei's avatar
dterei committed
870 871 872 873 874 875 876 877
          </row>
          <row>
            <entry><option>-XOverloadedStrings</option></entry>
            <entry>Enable <link linkend="overloaded-strings">overloaded string literals</link>.
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoOverloadedStrings</option></entry>
          </row>
878
          <row>
879 880
            <entry><option>-XQuasiQuotes</option></entry>
            <entry>Enable <link linkend="th-quasiquotation">quasiquotation</link>.</entry>
881
            <entry>dynamic</entry>
882
            <entry><option>-XNoQuasiQuotes</option></entry>
883
          </row>
dterei's avatar
dterei committed
884
          <row>
885 886
            <entry><option>-XRelaxedPolyRec</option></entry>
            <entry>Relaxed checking for <link linkend="typing-binds">mutually-recursive polymorphic functions</link></entry>
dterei's avatar
dterei committed
887
            <entry>dynamic</entry>
888
            <entry><option>-XNoRelaxedPolyRec</option></entry>
dterei's avatar
dterei committed
889 890
          </row>
          <row>
891 892
            <entry><option>-XNoTraditionalRecordSyntax</option></entry>
            <entry>Disable support for traditional record syntax (as supported by Haskell 98) <literal>C {f = x}</literal></entry>
dterei's avatar
dterei committed
893
            <entry>dynamic</entry>
894
            <entry><option>-XTraditionalRecordSyntax</option></entry>
dterei's avatar
dterei committed
895 896 897 898 899 900 901 902
          </row>
          <row>
            <entry><option>-XTypeFamilies</option></entry>
            <entry>Enable <link linkend="type-families">type families</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoTypeFamilies</option></entry>
          </row>
          <row>
903 904
            <entry><option>-XUndecidableInstances</option></entry>
            <entry>Enable <link linkend="undecidable-instances">undecidable instances</link></entry>
905
            <entry>dynamic</entry>
906
            <entry><option>-XNoUndecidableInstances</option></entry>
907
          </row>
dterei's avatar
dterei committed
908 909
          <row>
            <entry><option>-XPolyKinds</option></entry>
910 911
            <entry>Enable <link linkend="kind-polymorphism">kind polymorphism</link>.
                   Implies <option>-XKindSignatures</option>.</entry>
dterei's avatar
dterei committed
912 913 914 915 916 917
            <entry>dynamic</entry>
            <entry><option>-XNoPolyKinds</option></entry>
          </row>
          <row>
            <entry><option>-XMonoLocalBinds</option></entry>
            <entry>Enable <link linkend="mono-local-binds">do not generalise local bindings</link>.
918
              Implied by <option>-XTypeFamilies</option> and <option>-XGADTs</option>.
dterei's avatar
dterei committed
919 920 921 922
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoMonoLocalBinds</option></entry>
          </row>
923 924 925 926 927 928 929 930 931 932 933 934 935
          <row>
            <entry><option>-XRebindableSyntax</option></entry>
            <entry>Employ <link linkend="rebindable-syntax">rebindable syntax</link></entry>
            <entry>dynamic</entry>
            <entry><option>-XNoRebindableSyntax</option></entry>
          </row>
          <row>
            <entry><option>-XScopedTypeVariables</option></entry>
            <entry>Enable <link linkend="scoped-type-variables">lexically-scoped type variables</link>.
              Implied by <option>-fglasgow-exts</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoScopedTypeVariables</option></entry>
          </row>
dterei's avatar
dterei committed
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
          <row>
            <entry><option>-XTemplateHaskell</option></entry>
            <entry>Enable <link linkend="template-haskell">Template Haskell</link>.
              No longer implied by <option>-fglasgow-exts</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoTemplateHaskell</option></entry>
          </row>
          <row>
            <entry><option>-XBangPatterns</option></entry>
            <entry>Enable <link linkend="bang-patterns">bang patterns</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoBangPatterns</option></entry>
          </row>
          <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>
          </row>
          <row>
            <entry><option>-XPatternGuards</option></entry>
            <entry>Enable <link linkend="pattern-guards">pattern guards</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoPatternGuards</option></entry>
          </row>
          <row>
            <entry><option>-XViewPatterns</option></entry>
            <entry>Enable <link linkend="view-patterns">view patterns</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoViewPatterns</option></entry>
          </row>
          <row>
            <entry><option>-XUnicodeSyntax</option></entry>
            <entry>Enable <link linkend="unicode-syntax">unicode syntax</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoUnicodeSyntax</option></entry>
          </row>
          <row>
            <entry><option>-XMagicHash</option></entry>
            <entry>Allow "#" as a <link linkend="magic-hash">postfix modifier on identifiers</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoMagicHash</option></entry>
          </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>,
              <option>-XRankNTypes</option>,
              <option>-XExistentialQuantification</option>
            </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoExplicitForAll</option></entry>
          </row>
          <row>
            <entry><option>-XPolymorphicComponents</option></entry>
            <entry>Enable <link linkend="universal-quantification">polymorphic components for data constructors</link>.</entry>
993
            <entry>dynamic, synonym for <option>-XRankNTypes</option></entry>
dterei's avatar
dterei committed
994 995 996 997 998
            <entry><option>-XNoPolymorphicComponents</option></entry>
          </row>
          <row>
            <entry><option>-XRank2Types</option></entry>
            <entry>Enable <link linkend="universal-quantification">rank-2 types</link>.</entry>
999
            <entry>dynamic, synonym for <option>-XRankNTypes</option></entry>
dterei's avatar
dterei committed
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
            <entry><option>-XNoRank2Types</option></entry>
          </row>
          <row>
            <entry><option>-XRankNTypes</option></entry>
            <entry>Enable <link linkend="universal-quantification">rank-N types</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoRankNTypes</option></entry>
          </row>
          <row>
            <entry><option>-XImpredicativeTypes</option></entry>
            <entry>Enable <link linkend="impredicative-polymorphism">impredicative types</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoImpredicativeTypes</option></entry>
          </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>
          </row>
          <row>
            <entry><option>-XKindSignatures</option></entry>
            <entry>Enable <link linkend="kinding">kind signatures</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoKindSignatures</option></entry>
          </row>
          <row>
            <entry><option>-XEmptyDataDecls</option></entry>
            <entry>Enable empty data declarations.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoEmptyDataDecls</option></entry>
          </row>
          <row>
            <entry><option>-XParallelListComp</option></entry>
            <entry>Enable <link linkend="parallel-list-comprehensions">parallel list comprehensions</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoParallelListComp</option></entry>
          </row>
          <row>
            <entry><option>-XTransformListComp</option></entry>
            <entry>Enable <link linkend="generalised-list-comprehensions">generalised list comprehensions</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoTransformListComp</option></entry>
          </row>
          <row>
            <entry><option>-XMonadComprehensions</option></entry>
            <entry>Enable <link linkend="monad-comprehensions">monad comprehensions</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoMonadComprehensions</option></entry>
          </row>
          <row>
            <entry><option>-XUnliftedFFITypes</option></entry>
            <entry>Enable unlifted FFI types.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoUnliftedFFITypes</option></entry>
          </row>
          <row>
            <entry><option>-XInterruptibleFFI</option></entry>
            <entry>Enable interruptible FFI.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoInterruptibleFFI</option></entry>
          </row>
          <row>
            <entry><option>-XLiberalTypeSynonyms</option></entry>
            <entry>Enable <link linkend="type-synonyms">liberalised type synonyms</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoLiberalTypeSynonyms</option></entry>
          </row>
          <row>
            <entry><option>-XTypeOperators</option></entry>
1070
            <entry>Enable <link linkend="type-operators">type operators</link>.</entry>
dterei's avatar
dterei committed
1071 1072 1073
            <entry>dynamic</entry>
            <entry><option>-XNoTypeOperators</option></entry>
          </row>
1074 1075
          <row>
            <entry><option>-XExplicitNamespaces</option></entry>
1076 1077 1078
            <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>
1079 1080 1081
            <entry>dynamic</entry>
            <entry><option>-XNoExplicitNamespaces</option></entry>
          </row>
dterei's avatar
dterei committed
1082 1083
          <row>
            <entry><option>-XRecursiveDo</option></entry>
1084
            <entry>Enable <link linkend="recursive-do-notation">recursive do (mdo) notation</link>.</entry>
dterei's avatar
dterei committed
1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 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 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160
            <entry>dynamic</entry>
            <entry><option>-XNoRecursiveDo</option></entry>
          </row>
          <row>
            <entry><option>-XParallelArrays</option></entry>
            <entry>Enable parallel arrays.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoParallelArrays</option></entry>
          </row>
          <row>
            <entry><option>-XRecordWildCards</option></entry>
            <entry>Enable <link linkend="record-wildcards">record wildcards</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoRecordWildCards</option></entry>
          </row>
          <row>
            <entry><option>-XNamedFieldPuns</option></entry>
            <entry>Enable <link linkend="record-puns">record puns</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoNamedFieldPuns</option></entry>
          </row>
          <row>
            <entry><option>-XDisambiguateRecordFields</option></entry>
            <entry>Enable  <link linkend="disambiguate-fields">record field disambiguation</link>. </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoDisambiguateRecordFields</option></entry>
          </row>
          <row>
            <entry><option>-XUnboxedTuples</option></entry>
            <entry>Enable <link linkend="unboxed-tuples">unboxed tuples</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoUnboxedTuples</option></entry>
          </row>
          <row>
            <entry><option>-XStandaloneDeriving</option></entry>
            <entry>Enable <link linkend="stand-alone-deriving">standalone deriving</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoStandaloneDeriving</option></entry>
          </row>
          <row>
            <entry><option>-XTypeSynonymInstances</option></entry>
            <entry>Enable <link linkend="flexible-instance-head">type synonyms in instance heads</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoTypeSynonymInstances</option></entry>
          </row>
          <row>
            <entry><option>-XFlexibleContexts</option></entry>
            <entry>Enable <link linkend="flexible-contexts">flexible contexts</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoFlexibleContexts</option></entry>
          </row>
          <row>
            <entry><option>-XFlexibleInstances</option></entry>
            <entry>Enable <link linkend="instance-rules">flexible instances</link>.
              Implies <option>-XTypeSynonymInstances</option> </entry>
            <entry>dynamic</entry>
            <entry><option>-XNoFlexibleInstances</option></entry>
          </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>
          </row>
          <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>
          </row>
          <row>
            <entry><option>-XMultiParamTypeClasses</option></entry>
            <entry>Enable <link linkend="multi-param-type-classes">multi parameter type classes</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoMultiParamTypeClasses</option></entry>
          </row>
1161 1162 1163 1164 1165 1166
          <row>
            <entry><option>-XNullaryTypeClasses</option></entry>
            <entry>Enable <link linkend="nullary-type-classes">nullary (no parameter) type classes</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoNullaryTypeClasses</option></entry>
          </row>
dterei's avatar
dterei committed
1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178
          <row>
            <entry><option>-XFunctionalDependencies</option></entry>
            <entry>Enable <link linkend="functional-dependencies">functional dependencies</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoFunctionalDependencies</option></entry>
          </row>
          <row>
            <entry><option>-XPackageImports</option></entry>
            <entry>Enable <link linkend="package-imports">package-qualified imports</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoPackageImports</option></entry>
          </row>
1179 1180 1181 1182 1183 1184
          <row>
            <entry><option>-XLambdaCase</option></entry>
            <entry>Enable <link linkend="lambda-case">lambda-case expressions</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoLambdaCase</option></entry>
          </row>
1185 1186 1187 1188 1189 1190
          <row>
            <entry><option>-XMultiWayIf</option></entry>
            <entry>Enable <link linkend="multi-way-if">multi-way if-expressions</link>.</entry>
            <entry>dynamic</entry>
            <entry><option>-XNoMultiWayIf</option></entry>
          </row>
dterei's avatar
dterei committed
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
          <row>
            <entry><option>-XSafe</option></entry>
            <entry>Enable the <link linkend="safe-haskell">Safe Haskell</link> Safe mode.</entry>
            <entry>dynamic</entry>
            <entry><option>-</option></entry>
          </row>
          <row>
            <entry><option>-XTrustworthy</option></entry>
            <entry>Enable the <link linkend="safe-haskell">Safe Haskell</link> Trustworthy mode.</entry>
            <entry>dynamic</entry>
            <entry><option>-</option></entry>
          </row>
          <row>
            <entry><option>-XUnsafe</option></entry>
            <entry>Enable <link linkend="safe-haskell">Safe Haskell</link> Unsafe mode.</entry>
            <entry>dynamic</entry>
            <entry><option>-</option></entry>
          </row>
          <row>
1210 1211
            <entry><option>-XTypeHoles</option></entry>
            <entry>Enable <link linkend="type-holes">holes</link> in expressions.</entry>
dterei's avatar
dterei committed
1212
            <entry>dynamic</entry>
1213
            <entry><option>--XNoTypeHoles</option></entry>
dterei's avatar
dterei committed
1214
          </row>
Simon Peyton Jones's avatar
Simon Peyton Jones committed
1215
          <row>
1216 1217
            <entry><option>-fpackage-trust</option></entry>
            <entry>Enable <link linkend="safe-haskell">Safe Haskell</link> trusted package requirement for trustworty modules.</entry>
Simon Peyton Jones's avatar
Simon Peyton Jones committed
1218 1219 1220
            <entry>dynamic</entry>
            <entry><option>-</option></entry>
          </row>
dterei's avatar
dterei committed
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
        </tbody>
      </tgroup>
    </informaltable>
  </sect2>

  <sect2>
    <title>Warnings</title>

    <para><xref linkend="options-sanity"/></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>-W</option></entry>
            <entry>enable normal warnings</entry>
            <entry>dynamic</entry>
            <entry><option>-w</option></entry>
          </row>
          <row>
            <entry><option>-w</option></entry>
            <entry>disable all warnings</entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>
          <row>
            <entry><option>-Wall</option></entry>
            <entry>enable almost all warnings (details in <xref linkend="options-sanity"/>)</entry>
            <entry>dynamic</entry>
            <entry><option>-w</option></entry>
          </row>
          <row>
            <entry><option>-Werror</option></entry>
            <entry>make warnings fatal</entry>
            <entry>dynamic</entry>
            <entry>-Wwarn</entry>
          </row>
          <row>
            <entry><option>-Wwarn</option></entry>
            <entry>make warnings non-fatal</entry>
            <entry>dynamic</entry>
            <entry>-Werror</entry>
          </row>

          <row>
            <entry><option>-fdefer-type-errors</option></entry>
            <entry>Defer as many type errors as possible until runtime.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-defer-type-errors</option></entry>
          </row>

          <row>
            <entry><option>-fhelpful-errors</option></entry>
            <entry>Make suggestions for mis-spelled names.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-helpful-errors</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-deprecated-flags</option></entry>
            <entry>warn about uses of commandline flags that are deprecated</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-deprecated-flags</option></entry>
          </row>

1294 1295 1296 1297 1298 1299 1300
          <row>
            <entry><option>-fwarn-duplicate-constraints</option></entry>
            <entry>warn when a constraint appears duplicated in a type signature</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-duplicate-constraints</option></entry>
          </row>

dterei's avatar
dterei committed
1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409
          <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-identities</option></entry>
            <entry>warn about uses of Prelude numeric conversions that are probably
              the identity (and hence could be omitted)</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-identities</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-implicit-prelude</option></entry>
            <entry>warn when the Prelude is implicitly imported</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-implicit-prelude</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>

          <row>
            <entry><option>-fwarn-incomplete-uni-patterns</option></entry>
            <entry>warn when a pattern match in a lambda expression or pattern binding could fail</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-incomplete-uni-patterns</option></entry>
          </row>

          <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>

          <row>
            <entry><option>-fwarn-lazy-unlifted-bindings</option></entry>
            <entry>warn when a pattern binding looks lazy but must be strict</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-lazy-unlifted-bindings</option></entry>
          </row>

          <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-import-lists</option></entry>
            <entry>warn when an import declaration does not explicitly
              list all the names brought into scope</entry>
            <entry>dynamic</entry>
            <entry><option>-fnowarn-missing-import-lists</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-missing-local-sigs</option></entry>
            <entry>warn about polymorphic local bindings without signatures</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-missing-local-sigs</option></entry>
          </row>

          <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>

          <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>

          <row>
1410
            <entry><option>-fwarn-orphans, -fwarn-auto-orphans</option></entry>
dterei's avatar
dterei committed
1411 1412 1413
            <entry>warn when the module contains <link linkend="orphan-modules">orphan instance declarations
                or rewrite rules</link></entry>
            <entry>dynamic</entry>
1414
            <entry><option>-fno-warn-orphans, -fno-warn-auto-orphans</option></entry>
dterei's avatar
dterei committed
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504
          </row>

          <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-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>

          <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>

          <row>
            <entry><option>-fwarn-unrecognised-pragmas</option></entry>
            <entry>warn about uses of pragmas that GHC doesn't recognise</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-unrecognised-pragmas</option></entry>
          </row>

          <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>

          <row>
            <entry><option>-fwarn-unused-do-bind</option></entry>
            <entry>warn about do bindings that appear to throw away values of types other than <literal>()</literal></entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-unused-do-bind</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-wrong-do-bind</option></entry>
            <entry>warn about do bindings that appear to throw away monadic values that you should have bound instead</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-wrong-do-bind</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-unsafe</option></entry>
            <entry>warn if the module being compiled is regarded to be unsafe.
              Should be used to check the safety status of modules when using safe
              inference.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-unsafe</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-safe</option></entry>
            <entry>warn if the module being compiled is regarded to be safe.
              Should be used to check the safety status of modules when using safe
              inference.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-safe</option></entry>
          </row>

          <row>
            <entry><option>-fwarn-warnings-deprecations</option></entry>
            <entry>warn about uses of functions &amp; types that have warnings or deprecated pragmas</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-warnings-deprecations</option></entry>
          </row>

1505 1506 1507 1508 1509 1510 1511 1512
          <row>
            <entry><option>-fwarn-typeable-instances</option></entry>
            <entry>warn if there are any handwritten <literal>Typeable</literal>
                   instances (see <xref linkend="deriving-typeable"/>)</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-warn-typeable-instances</option></entry>
          </row>

dterei's avatar
dterei committed
1513 1514 1515 1516 1517 1518 1519 1520
        </tbody>
      </tgroup>
    </informaltable>

  </sect2>
  <sect2>
    <title>Optimisation levels</title>

1521
    <para>These options are described in more detail in <xref linkend="options-optimise"/></para>
dterei's avatar
dterei committed
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550

    <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>-O</option></entry>
            <entry>Enable default optimisation (level 1)</entry>
            <entry>dynamic</entry>
            <entry><option>-O0</option></entry>
          </row>
          <row>
            <entry><option>-O</option><replaceable>n</replaceable></entry>
            <entry>Set optimisation level <replaceable>n</replaceable></entry>
            <entry>dynamic</entry>
            <entry><option>-O0</option></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>

  </sect2>
1551
  <sect2 id="options-f-compact">
dterei's avatar
dterei committed
1552 1553
    <title>Individual optimisations</title>

1554
    <para>These options are described in more detail in <xref linkend="options-f"/>.</para>
dterei's avatar
dterei committed
1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577

    <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>-fcase-merge</option></entry>
            <entry>Enable case-merging. Implied by <option>-O</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-case-merge</option></entry>
          </row>

          <row>
            <entry><option>-fcse</option></entry>
            <entry>Turn on common sub-expression elimination. Implied by <option>-O</option>.</entry>
            <entry>dynamic</entry>
1578
            <entry><option>-fno-cse</option></entry>
dterei's avatar
dterei committed
1579 1580 1581 1582 1583 1584 1585 1586 1587
          </row>

          <row>
            <entry><option>-fdicts-strict</option></entry>
            <entry>Make dictionaries strict</entry>
            <entry>static</entry>
            <entry><option>-fno-dicts-strict</option></entry>
          </row>

1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598
          <row>
            <entry><option>-ffun-to-thunk</option></entry>
            <entry>Worker-wrapper removes unused arguments; this flag
            lets it thusly remove all value lambdas. Doing so creates
            a thunk where it was previously a function closure, which
            may save recomputation but also risks a space leak. Off by
            default.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-fun-to-thunk</option></entry>
          </row>

dterei's avatar
dterei committed
1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628
          <row>
            <entry><option>-fdo-eta-reduction</option></entry>
            <entry>Enable eta-reduction. Implied by <option>-O</option>.</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-do-eta-reduction</option></entry>
          </row>

          <row>
            <entry><option>-fdo-lambda-eta-expansion</option></entry>
            <entry>Enable lambda eta-reduction</entry>
            <entry>dynamic</entry>
            <entry><option>-fno-do-lambda-eta-expansion</option></entry>
          </row>

          <row>
            <entry><option>-feager-blackholing</option></entry>
            <entry>Turn on <link linkend="parallel-compile-options">eager blackholing</link></entry>
            <entry>dynamic</entry>
            <entry>-</entry>
          </row>

          <row>
            <entry><option>-fenable-rewrite-rules</option></entry>
            <entry>Switch on all rewrite rules (including rules
              generated by automatic specialisation of overloaded functions).
              Implied by <option>-O</option>. </entry>
            <entry>dynamic</entry>
            <entry><option>-fno-enable-rewrite-rules</option></entry>
          </row>

chak@cse.unsw.edu.au.'s avatar
chak@cse.unsw.edu.au. committed
1629 1630 1631 1632 1633 1634 1635