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

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

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

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

      <informaltable>
16
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
17
18
19
20
21
22
23
24
25
26
27
28
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>-?</option></entry>
	      <entry>help</entry>
29
	      <entry>mode</entry>
30
31
32
33
34
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-help</option></entry>
	      <entry>help</entry>
35
	      <entry>mode</entry>
36
37
	      <entry>-</entry>
	    </row>
Simon Marlow's avatar
Simon Marlow committed
38
            <row>
39
40
41
42
43
44
45
46
47
48
49
	      <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>
50
51
52
	    <row>
	      <entry><option>-V</option></entry>
	      <entry>display GHC version</entry>
53
	      <entry>mode</entry>
54
55
	      <entry>-</entry>
	    </row>
Ian Lynagh's avatar
Ian Lynagh committed
56
	    <row>
Ian Lynagh's avatar
Ian Lynagh committed
57
58
	      <entry><option>&ndash;&ndash;supported-extensions</option> or <option>&ndash;&ndash;supported-languages</option></entry>
	      <entry>display the supported languages and language extensions</entry>
Ian Lynagh's avatar
Ian Lynagh committed
59
60
61
	      <entry>mode</entry>
	      <entry>-</entry>
	    </row>
Ian Lynagh's avatar
Ian Lynagh committed
62
63
64
65
66
67
	    <row>
	      <entry><option>&ndash;&ndash;info</option></entry>
	      <entry>display information about the compiler</entry>
	      <entry>mode</entry>
	      <entry>-</entry>
	    </row>
68
	    <row>
69
	      <entry><option>&ndash;&ndash;version</option></entry>
70
	      <entry>display GHC version</entry>
71
	      <entry>mode</entry>
72
73
74
	      <entry>-</entry>
	    </row>
	    <row>
75
	      <entry><option>&ndash;&ndash;numeric-version</option></entry>
76
	      <entry>display GHC version (numeric only)</entry>
77
	      <entry>mode</entry>
78
79
	      <entry>-</entry>
	    </row>
80
	    <row>
81
	      <entry><option>&ndash;&ndash;print-libdir</option></entry>
82
	      <entry>display GHC library directory</entry>
83
	      <entry>mode</entry>
84
	      <entry>-</entry>
Ian Lynagh's avatar
Ian Lynagh committed
85
	    </row>
86
87
88
89
90
91
	    <row>
	      <entry><option>-ferror-spans</option></entry>
	      <entry>output full span in error messages</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
92
93
94
95
96
97
	    <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>
98
99
100
101
102
103
	    <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>
104
105
106
107
108
109
	  </tbody>
	</tgroup>
      </informaltable>

    </sect2>
    <sect2>
110
      <title>Which phases to run</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
111

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

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

     <sect2>
161
      <title>Alternative modes of operation</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
162

163
164
      <para><xref linkend="modes"/></para>

165
      <informaltable>
166
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
167
168
169
170
171
172
173
174
175
176
177
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
	      <entry><option>--interactive</option></entry>
178
179
	      <entry>Interactive mode - normally used by just running <command>ghci</command>;
	      see <xref linkend="ghci"/> for details.</entry>
180
	      <entry>mode</entry>
181
182
183
184
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>--make</option></entry>
185
186
	      <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>
187
	      <entry>mode</entry>
188
189
190
191
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-e <replaceable>expr</replaceable></option></entry>
192
193
	      <entry>Evaluate <replaceable>expr</replaceable>;
	      see <xref linkend="eval-mode"/> for details.</entry>
194
	      <entry>mode</entry>
195
196
197
198
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-M</option></entry>
199
200
	      <entry>Generate dependency information suitable for use in a <filename>Makefile</filename>;
	      see <xref linkend="makefile-dependencies"/> for details.</entry>
201
	      <entry>mode</entry>
202
203
204
205
206
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
207
208
209
    </sect2>

    <sect2>
210
      <title>Redirecting output</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
211

212
213
      <para><xref linkend="options-output"/></para>

214
      <informaltable>
215
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
216
217
218
219
220
221
222
223
224
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
225
226
227
	    <row>
	      <entry><option>-hcsuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for intermediate C files</entry>
228
	      <entry>dynamic</entry>
229
230
	      <entry>-</entry>
	    </row>
231
232
233
	    <row>
	      <entry><option>-hidir</option> <replaceable>dir</replaceable></entry>
	      <entry>set directory for interface files</entry>
234
	      <entry>dynamic</entry>
235
236
	      <entry>-</entry>
	    </row>
237
238
239
	    <row>
	      <entry><option>-hisuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the suffix to use for interface files</entry>
240
	      <entry>dynamic</entry>
241
242
243
244
245
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-o</option> <replaceable>filename</replaceable></entry>
	      <entry>set output filename</entry>
246
	      <entry>dynamic</entry>
247
248
249
250
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-odir</option> <replaceable>dir</replaceable></entry>
Simon Marlow's avatar
Simon Marlow committed
251
	      <entry>set directory for object files</entry>
252
	      <entry>dynamic</entry>
253
254
255
256
257
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ohi</option> <replaceable>filename</replaceable></entry>
	      <entry>set the filename in which to put the interface</entry>
258
	      <entry>dynamic</entry>
259
260
261
262
263
	      <entry></entry>
	    </row>
	    <row>
	      <entry><option>-osuf</option> <replaceable>suffix</replaceable></entry>
	      <entry>set the output file suffix</entry>
264
	      <entry>dynamic</entry>
265
266
	      <entry>-</entry>
	    </row>
267
268
	    <row>
	      <entry><option>-stubdir</option> <replaceable>dir</replaceable></entry>
269
270
271
272
273
274
275
	      <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>
276
277
278
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
Simon Marlow's avatar
Simon Marlow committed
279
280
281
282
283
284
	    <row>
	      <entry><option>-outputdir</option> <replaceable>dir</replaceable></entry>
	      <entry>set output directory</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
285
286
287
288
289
290
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
291
      <title>Keeping intermediate files</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
292

293
      <para><xref linkend="keeping-intermediates"/></para>
daniel.is.fischer's avatar
daniel.is.fischer committed
294

295
      <informaltable>
296
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
297
298
299
300
301
302
303
304
305
306
	  <thead>
	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
Ian Lynagh's avatar
Ian Lynagh committed
307
308
	      <entry><option>-keep-hc-file</option> or
                 <option>-keep-hc-files</option></entry>
309
	      <entry>retain intermediate <literal>.hc</literal> files</entry>
310
	      <entry>dynamic</entry>
311
312
	      <entry>-</entry>
	    </row>
313
314
315
316
317
318
319
	    <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>
320
	    <row>
Ian Lynagh's avatar
Ian Lynagh committed
321
322
	      <entry><option>-keep-s-file</option> or
                 <option>-keep-s-files</option></entry>
323
	      <entry>retain intermediate <literal>.s</literal> files</entry>
324
	      <entry>dynamic</entry>
325
326
327
328
329
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-keep-tmp-files</option></entry>
	      <entry>retain all intermediate temporary files</entry>
330
	      <entry>dynamic</entry>
331
332
333
334
335
336
337
338
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
339
      <title>Temporary files</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
340

341
342
      <para><xref linkend="temp-files"/></para>

343
      <informaltable>
344
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
345
346
347
348
349
350
351
352
353
354
355
356
	  <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>
357
	      <entry>dynamic</entry>
358
359
360
361
362
363
364
365
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
366
367
368
      <title>Finding imports</title>

      <para><xref linkend="search-path"/></para>
369
370

      <informaltable>
371
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
372
373
374
375
376
377
378
379
380
381
382
383
384
385
	  <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>
386
	      <entry>static/<literal>:set</literal></entry>
387
388
389
390
391
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-i</option></entry>
	      <entry>Empty the import directory list</entry>
392
	      <entry>static/<literal>:set</literal></entry>
393
394
395
396
397
398
399
400
	      <entry>-</entry>
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
401
402
403
      <title>Interface file options</title>

      <para><xref linkend="hi-options"/></para>
404
405

      <informaltable>
406
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
	  <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>
427
428
429
430
431
432
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ddump-minimal-imports</option></entry>
	      <entry>Dump a minimal set of imports</entry>
	      <entry>dynamic</entry>
433
434
	      <entry>-</entry>
	    </row>
435
436
	    <row>
	      <entry><option>--show-iface</option> <replaceable>file</replaceable></entry>
437
	      <entry>See <xref linkend="modes"/>.</entry>
438
	    </row>
439
440
441
442
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>
daniel.is.fischer's avatar
daniel.is.fischer committed
443

444
    <sect2>
445
446
447
      <title>Recompilation checking</title>

      <para><xref linkend="recomp"/></para>
448
449

      <informaltable>
450
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
451
452
453
454
455
456
457
458
459
460
461
	  <thead>
	    <row>
	      <entry>Flag</entry>

	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
462
	      <entry><option>-fforce-recomp</option></entry>
463
464
465
	      <entry>Turn off recompilation checking; implied by any
	      <option>-ddump-X</option> option</entry>
	      <entry>dynamic</entry>
466
	      <entry><option>-fno-force-recomp</option></entry>
467
468
469
470
471
472
	    </row>
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

473
    <sect2 id="interactive-mode-options">
474
      <title>Interactive-mode options</title>
daniel.is.fischer's avatar
daniel.is.fischer committed
475

476
477
      <para><xref linkend="ghci-dot-files"/></para>

478
      <informaltable>
479
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
480
	  <thead>
481
	    <row>
482
483
484
485
486
487
488
489
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
490
491
	      <entry><option>-ignore-dot-ghci</option></entry>
	      <entry>Disable reading of <filename>.ghci</filename> files</entry>
492
493
494
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
495
496
497
498
499
500
	    <row>
	      <entry><option>-ghci-script</option></entry>
	      <entry>Load the given additional <filename>.ghci</filename> file</entry>
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
501
	    <row>
502
503
	      <entry><option>-read-dot-ghci</option></entry>
	      <entry>Enable reading of <filename>.ghci</filename> files</entry>
504
505
506
	      <entry>static</entry>
	      <entry>-</entry>
	    </row>
mnislaih's avatar
mnislaih committed
507
508
509
510
511
512
513
514
515
516
517
518
	    <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>
519
520
521
522
523
	    <row>
	      <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>
daniel.is.fischer's avatar
daniel.is.fischer committed
524
	    </row>
525
	    <row>
526
527
	      <entry><option>-fprint-bind-result</option></entry>
	      <entry><link linkend="ghci-stmts">Turn on printing of binding results in GHCi</link></entry>
528
	      <entry>dynamic</entry>
529
	      <entry><option>-fno-print-bind-result</option></entry>
530
	    </row>
531
532
533
534
535
536
	    <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>
537
538
539
540
541
542
543
	    <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>
	      <entry>-</entry>
	    </row>
544

545
546
547
548
549
550
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
551
552
553
554
      <title>Packages</title>

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

555
      <informaltable>
556
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
557
558
559
560
561
562
563
564
565
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
566
567
568
	    <row>
	      <entry><option>-package-name</option> <replaceable>P</replaceable></entry>
	      <entry>Compile to be part of package <replaceable>P</replaceable></entry>
569
              <entry>static</entry>
570
571
	      <entry>-</entry>
	    </row>
572
	    <row>
573
574
	      <entry><option>-package</option> <replaceable>P</replaceable></entry>
	      <entry>Expose package <replaceable>P</replaceable></entry>
575
	      <entry>static/<literal>:set</literal></entry>
576
	      <entry>-</entry>
577
578
579
580
581
582
	    </row>
	    <row>
	      <entry><option>-hide-all-packages</option></entry>
	      <entry>Hide all packages by default</entry>
	      <entry>static</entry>
	      <entry>-</entry>
583
584
585
586
	    </row>
	    <row>
	      <entry><option>-hide-package</option> <replaceable>name</replaceable></entry>
	      <entry>Hide package <replaceable>P</replaceable></entry>
587
	      <entry>static/<literal>:set</literal></entry>
588
589
590
591
592
	      <entry>-</entry>
	    </row>
	    <row>
	      <entry><option>-ignore-package</option> <replaceable>name</replaceable></entry>
	      <entry>Ignore package <replaceable>P</replaceable></entry>
593
	      <entry>static/<literal>:set</literal></entry>
594
595
596
	      <entry>-</entry>
	    </row>
	    <row>
597
598
	      <entry><option>-package-conf</option> <replaceable>file</replaceable></entry>
	      <entry>Load more packages from <replaceable>file</replaceable></entry>
599
	      <entry>static</entry>
600
601
602
	      <entry>-</entry>
	    </row>
	    <row>
603
604
	      <entry><option>-no-user-package-conf</option></entry>
	      <entry>Don't load the user's package config file.</entry>
605
	      <entry>static</entry>
606
607
	      <entry>-</entry>
	    </row>
608
609
610
611
612
613
	    <row>
	      <entry><option>-no-auto-link-packages</option></entry>
	      <entry>Don't automatically link in the haskell98 package.</entry>
	      <entry>dynamic</entry>
	      <entry>-</entry>
	    </row>
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
	    <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>
634
635
636
637
638
639
	  </tbody>
	</tgroup>
      </informaltable>
    </sect2>

    <sect2>
640
641
      <title>Language options</title>

daniel.is.fischer's avatar
daniel.is.fischer committed
642
      <para>Language options can be enabled either by a command-line option
643
644
      <option>-Xblah</option>, or by a <literal>{-# LANGUAGE blah #-}</literal>
      pragma in the file itself.  See <xref linkend="options-language"/></para>
645
646

      <informaltable>
647
	<tgroup cols="4" align="left" colsep="1" rowsep="1">
648
649
650
651
652
653
654
655
656
657
	  <thead>
    	    <row>
	      <entry>Flag</entry>
	      <entry>Description</entry>
	      <entry>Static/Dynamic</entry>
	      <entry>Reverse</entry>
	    </row>
	  </thead>
	  <tbody>
	    <row>
658
	      <entry><option>-fglasgow-exts</option></entry>
659
	      <entry>Enable most language extensions; see <xref linkend="options-language"/> for exactly which ones.</entry>
660
661
662
663
	      <entry>dynamic</entry>
	      <entry><option>-fno-glasgow-exts</option></entry>
	    </row>
	    <row>
664
	      <entry><option>-XOverlappingInstances</option></entry>
665
	      <entry>Enable <link linkend="instance-overlap">overlapping instances</link></entry>
666
	      <entry>dynamic</entry>
667
	      <entry><option>-XNoOverlappingInstances</option></entry>
668
	    </row>
669
	    <row>
670
	      <entry><option>-XIncoherentInstances</option></entry>
daniel.is.fischer's avatar
daniel.is.fischer committed
671
	      <entry>Enable <link linkend="instance-overlap">incoherent instances</link>.
672
	      Implies <option>-XOverlappingInstances</option> </entry>
673
	      <entry>dynamic</entry>
674
	      <entry><option>-XNoIncoherentInstances</option></entry>
675
676
	    </row>
	    <row>
677
	      <entry><option>-XUndecidableInstances</option></entry>
678
	      <entry>Enable <link linkend="undecidable-instances">undecidable instances</link></entry>
679
	      <entry>dynamic</entry>
680
	      <entry><option>-XNoUndecidableInstances</option></entry>
681
	    </row>
682
	    <row>
683
	      <entry><option>-fcontext-stack=N</option><replaceable>n</replaceable></entry>
684
	      <entry>set the <link linkend="undecidable-instances">limit for context reduction</link>. Default is 20.</entry>
685
	      <entry>dynamic</entry>
686
	      <entry></entry>
687
	    </row>
688
	    <row>
689
	      <entry><option>-XArrows</option></entry>
690
691
692
	      <entry>Enable <link linkend="arrow-notation">arrow
	      notation</link> extension</entry>
	      <entry>dynamic</entry>
693
	      <entry><option>-XNoArrows</option></entry>
694
	    </row>
695
	    <row>
696
	      <entry><option>-XDisambiguateRecordFields</option></entry>
daniel.is.fischer's avatar
daniel.is.fischer committed
697
	      <entry>Enable <link linkend="disambiguate-fields">record
698
699
	      field disambiguation</link></entry>
	      <entry>dynamic</entry>
700
	      <entry><option>-XNoDisambiguateRecordFields</option></entry>
701
	    </row>
chak's avatar
chak committed
702
	    <row>
703
	      <entry><option>-XForeignFunctionInterface</option></entry>
704
	      <entry>Enable <link linkend="ffi">foreign function interface</link> (implied by
chak's avatar
chak committed
705
706
	      <option>-fglasgow-exts</option>)</entry>
	      <entry>dynamic</entry>
707
	      <entry><option>-XNoForeignFunctionInterface</option></entry>
ross's avatar
ross committed
708
709
	    </row>
	    <row>
710
	      <entry><option>-XGenerics</option></entry>
711
	      <entry>Deprecated, does nothing. No longer enables <link linkend="generic-classes">generic classes</link>.
712
713
               See also GHC's support for
               <link linkend="generic-programming">generic programming</link>.</entry>
ross's avatar
ross committed
714
	      <entry>dynamic</entry>
715
	      <entry><option>-XNoGenerics</option></entry>
chak's avatar
chak committed
716
	    </row>
717
	    <row>
718
	      <entry><option>-XImplicitParams</option></entry>
719
	      <entry>Enable <link linkend="implicit-parameters">Implicit Parameters</link>.
720
	      Implied by <option>-fglasgow-exts</option>.</entry>
721
	      <entry>dynamic</entry>
722
	      <entry><option>-XNoImplicitParams</option></entry>
723
724
725
726
727
728
729
	    </row>
	    <row>
	      <entry><option>-firrefutable-tuples</option></entry>
	      <entry>Make tuple pattern matching irrefutable</entry>
	      <entry>dynamic</entry>
	      <entry><option>-fno-irrefutable-tuples</option></entry>
	    </row>
730
	    <row>
731
	      <entry><option>-XNoImplicitPrelude</option></entry>
732
733
	      <entry>Don't implicitly <literal>import Prelude</literal></entry>
	      <entry>dynamic</entry>
734
	      <entry><option>-XImplicitPrelude</option></entry>
735
	    </row>
736
737
738
739
740
741
	    <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>
742
	    <row>
743
	      <entry><option>-XNoMonomorphismRestriction</option></entry>
744
	      <entry>Disable the <link linkend="monomorphism">monomorphism restriction</link></entry>
745
	      <entry>dynamic</entry>
746
	      <entry><option>-XMonomorphismRrestriction</option></entry>
747
	    </row>
748
749
750
751
752
753
	    <row>
	      <entry><option>-XNoNPlusKPatterns</option></entry>
	      <entry>Disable support for <literal>n+k</literal> patterns</entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNPlusKPatterns</option></entry>
	    </row>
Ian Lynagh's avatar
Ian Lynagh committed
754
755
756
757
758
759
	    <row>
	      <entry><option>-XNoTraditionalRecordSyntax</option></entry>
	      <entry>Disable support for traditional record syntax (as supported by Haskell 98) <literal>C {f = x}</literal></entry>
	      <entry>dynamic</entry>
	      <entry><option>-XTraditionalRecordSyntax</option></entry>
	    </row>
760
	    <row>
761
	      <entry><option>-XNoMonoPatBinds</option></entry>
762
	      <entry>Make <link linkend="monomorphism">pattern bindings polymorphic</link></entry>
763
	      <entry>dynamic</entry>
764
	      <entry><option>-XMonoPatBinds</option></entry>
765
	    </row>
766
	    <row>
767
	      <entry><option>-XRelaxedPolyRec</option></entry>
768
769
	      <entry>Relaxed checking for <link linkend="typing-binds">mutually-recursive polymorphic functions</link></entry>
	      <entry>dynamic</entry>
770
	      <entry><option>-XNoRelaxedPolyRec</option></entry>
771
	    </row>
772
	    <row>
773
	      <entry><option>-XExtendedDefaultRules</option></entry>
774
	      <entry>Use GHCi's <link linkend="extended-default-rules">extended default rules</link> in a normal module</entry>
775
	      <entry>dynamic</entry>
776
	      <entry><option>-XNoExtendedDefaultRules</option></entry>
777
	    </row>
778
	    <row>
779
	      <entry><option>-XOverloadedStrings</option></entry>
780
781
782
	      <entry>Enable <link linkend="overloaded-strings">overloaded string literals</link>.
	      </entry>
	      <entry>dynamic</entry>
783
	      <entry><option>-XNoOverloadedStrings</option></entry>
784
785
	    </row>
	    <row>
786
	      <entry><option>-XGADTs</option></entry>
simonpj@microsoft.com's avatar
simonpj@microsoft.com committed
787
	      <entry>Enable <link linkend="gadt">generalised algebraic data types</link>.
788
789
	      </entry>
	      <entry>dynamic</entry>
790
	      <entry><option>-XNoGADTs</option></entry>
791
	    </row>
Ian Lynagh's avatar
Ian Lynagh committed
792
793
794
795
796
797
798
	    <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>
799
	    <row>
800
	      <entry><option>-XTypeFamilies</option></entry>
801
802
	      <entry>Enable <link linkend="type-families">type families</link>.</entry>
	      <entry>dynamic</entry>
803
	      <entry><option>-XNoTypeFamilies</option></entry>
804
	    </row>
batterseapower's avatar
batterseapower committed
805
	    <row>
806
	      <entry><option>-XConstraintKinds</option></entry>
batterseapower's avatar
batterseapower committed
807
808
	      <entry>Enable a <link linkend="constraint-kind">kind of constraints</link>.</entry>
	      <entry>dynamic</entry>
809
	      <entry><option>-XNoConstraintKinds</option></entry>
batterseapower's avatar
batterseapower committed
810
	    </row>
811
812
813
814
815
816
817
	    <row>
	      <entry><option>-XPolyKinds</option></entry>
	      <entry>Enable <link linkend="kind-polymorphism">kind polymorphism</link>.
                     Implies <option>-XKindSignatures</option>.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoPolyKinds</option></entry>
	    </row>
818
	    <row>
819
	      <entry><option>-XScopedTypeVariables</option></entry>
820
	      <entry>Enable <link linkend="scoped-type-variables">lexically-scoped type variables</link>.
821
822
	      Implied by <option>-fglasgow-exts</option>.</entry>
	      <entry>dynamic</entry>
823
	      <entry><option>-XNoScopedTypeVariables</option></entry>
824
	    </row>
825
826
827
828
829
830
831
	    <row>
	      <entry><option>-XMonoLocalBinds</option></entry>
	      <entry>Enable <link linkend="mono-local-binds">do not generalise local bindings</link>.
	      </entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoMonoLocalBinds</option></entry>
	    </row>
832
	    <row>
833
	      <entry><option>-XTemplateHaskell</option></entry>
daniel.is.fischer's avatar
daniel.is.fischer committed
834
	      <entry>Enable <link linkend="template-haskell">Template Haskell</link>.
835
		No longer implied by <option>-fglasgow-exts</option>.</entry>
836
	      <entry>dynamic</entry>
837
	      <entry><option>-XNoTemplateHaskell</option></entry>
838
	    </row>
839
840
841
842
843
844
	    <row>
	      <entry><option>-XQuasiQuotes</option></entry>
	      <entry>Enable <link linkend="th-quasiquotation">quasiquotation</link>.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoQuasiQuotes</option></entry>
	    </row>
845
	    <row>
846
	      <entry><option>-XBangPatterns</option></entry>
847
	      <entry>Enable <link linkend="bang-patterns">bang patterns</link>.</entry>
848
	      <entry>dynamic</entry>
849
	      <entry><option>-XNoBangPatterns</option></entry>
850
	    </row>
851
	    <row>
852
	      <entry><option>-XCPP</option></entry>
853
854
	      <entry>Enable the <link linkend="c-pre-processor">C preprocessor</link>.</entry>
	      <entry>dynamic</entry>
855
	      <entry><option>-XNoCPP</option></entry>
856
857
	    </row>
	    <row>
858
	      <entry><option>-XPatternGuards</option></entry>
859
860
	      <entry>Enable <link linkend="pattern-guards">pattern guards</link>.</entry>
	      <entry>dynamic</entry>
861
	      <entry><option>-XNoPatternGuards</option></entry>
862
	    </row>
863
864
865
866
867
868
	    <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>
869
	    <row>
870
	      <entry><option>-XUnicodeSyntax</option></entry>
Simon Marlow's avatar
Simon Marlow committed
871
	      <entry>Enable <link linkend="unicode-syntax">unicode syntax</link>.</entry>
872
	      <entry>dynamic</entry>
873
	      <entry><option>-XNoUnicodeSyntax</option></entry>
874
875
	    </row>
	    <row>
876
	      <entry><option>-XMagicHash</option></entry>
877
	      <entry>Allow "#" as a <link linkend="magic-hash">postfix modifier on identifiers</link>.</entry>
878
	      <entry>dynamic</entry>
879
	      <entry><option>-XNoMagicHash</option></entry>
880
	    </row>
881
	    <row>
daniel.is.fischer's avatar
daniel.is.fischer committed
882
	      <entry><option>-XExplicitForAll</option></entry>
883
884
885
886
887
888
889
890
891
892
893
	      <entry>Enable <link linkend="explicit-foralls">explicit universal quantification</link>.
              Implied by <option>-XScopedTypeVariables</option>,
	    <option>-XLiberalTypeSynonyms</option>,
	    <option>-XRank2Types</option>,
	    <option>-XRankNTypes</option>,
	    <option>-XPolymorphicComponents</option>,
	    <option>-XExistentialQuantification</option>
              </entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoExplicitForAll</option></entry>
	    </row>
894
	    <row>
895
	      <entry><option>-XPolymorphicComponents</option></entry>
896
	      <entry>Enable <link linkend="universal-quantification">polymorphic components for data constructors</link>.</entry>
897
	      <entry>dynamic</entry>
898
	      <entry><option>-XNoPolymorphicComponents</option></entry>
899
	    </row>
900
901
902
903
904
905
906
907
908
909
910
911
	    <row>
	      <entry><option>-XRank2Types</option></entry>
	      <entry>Enable <link linkend="universal-quantification">rank-2 types</link>.</entry>
	      <entry>dynamic</entry>
	      <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>
912
913
914
915
916
917
	    <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>
918
	    <row>
919
	      <entry><option>-XExistentialQuantification</option></entry>
920
921
	      <entry>Enable <link linkend="existential-quantification">existential quantification</link>.</entry>
	      <entry>dynamic</entry>
922
	      <entry><option>-XNoExistentialQuantification</option></entry>
923
924
	    </row>
	    <row>
925
	      <entry><option>-XKindSignatures</option></entry>
926
	      <entry>Enable <link linkend="kinding">kind signatures</link>.</entry>
927
	      <entry>dynamic</entry>
928
	      <entry><option>-XNoKindSignatures</option></entry>
929
930
	    </row>
	    <row>
931
	      <entry><option>-XEmptyDataDecls</option></entry>
932
933
	      <entry>Enable empty data declarations.</entry>
	      <entry>dynamic</entry>
934
	      <entry><option>-XNoEmptyDataDecls</option></entry>
935
936
	    </row>
	    <row>
937
	      <entry><option>-XParallelListComp</option></entry>
938
939
	      <entry>Enable <link linkend="parallel-list-comprehensions">parallel list comprehensions</link>.</entry>
	      <entry>dynamic</entry>
940
	      <entry><option>-XNoParallelListComp</option></entry>
941
	    </row>
942
943
	    <row>
	      <entry><option>-XTransformListComp</option></entry>
944
	      <entry>Enable <link linkend="generalised-list-comprehensions">generalised list comprehensions</link>.</entry>
945
946
947
	      <entry>dynamic</entry>
	      <entry><option>-XNoTransformListComp</option></entry>
	    </row>
948
949
950
951
952
953
        <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>
954
	    <row>
955
	      <entry><option>-XUnliftedFFITypes</option></entry>
956
957
	      <entry>Enable unlifted FFI types.</entry>
	      <entry>dynamic</entry>
958
	      <entry><option>-XNoUnliftedFFITypes</option></entry>
959
	    </row>
960
961
962
963
964
965
	    <row>
	      <entry><option>-XInterruptibleFFI</option></entry>
	      <entry>Enable interruptible FFI.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoInterruptibleFFI</option></entry>
	    </row>
966
	    <row>
967
968
	      <entry><option>-XLiberalTypeSynonyms</option></entry>
	      <entry>Enable <link linkend="type-synonyms">liberalised type synonyms</link>.</entry>
969
	      <entry>dynamic</entry>
970
	      <entry><option>-XNoLiberalTypeSynonyms</option></entry>
971
972
	    </row>
	    <row>
973
	      <entry><option>-XTypeOperators</option></entry>
974
975
	      <entry>Enable type operators.</entry>
	      <entry>dynamic</entry>
976
	      <entry><option>-XNoTypeOperators</option></entry>
977
	    </row>
978
979
980
981
982
983
	    <row>
	      <entry><option>-XDoRec</option></entry>
	      <entry>Enable <link linkend="recursive-do-notation">recursive do notation</link>.</entry>
	      <entry>dynamic</entry>
	      <entry><option>-XNoDoRec</option></entry>
	    </row>
984
	    <row>
985
	      <entry><option>-XRecursiveDo</option></entry>
986
	      <entry>Enable <link linkend="mdo-notation">recursive do (mdo) notation</link>. This is deprecated; please use <link linkend="recursive-do-notation">recursive do notation</link> instead.</entry>
987
	      <entry>dynamic</entry>
988
	      <entry><option>-XNoRecursiveDo</option></entry>
989
990
	    </row>
	    <row>
991
	      <entry><option>-XParallelArrays</option></entry>
992
993
	      <entry>Enable parallel arrays.</entry>
	      <entry>dynamic</entry>
994
	      <entry><option>-XNoParallelArrays</option></entry>
995
996
	    </row>
	    <row>
997
	      <entry><option>-XRecordWildCards</option></entry>
998
	      <entry>Enable <link linkend="record-wildcards">record wildcards</link>.</entry>
999
	      <entry>dynamic</entry>
1000
	      <entry><option>-XNoRecordWildCards</option></entry>
1001
1002
	    </row>
	    <row>
1003
	      <entry><option>-XNamedFieldPuns</option></entry>
1004
	      <entry>Enable <link linkend="record-puns">record puns</link>.</entry>
1005
	      <entry>dynamic</entry>
1006
	      <entry><option>-XNoNamedFieldPuns</option></entry>
1007
1008
	    </row>
	    <row>
1009
	      <entry><option>-XDisambiguateRecordFields</option></entry>
1010
	      <entry>Enable  <link linkend="disambiguate-fields">record field disambiguation</link>. </entry>
1011
	      <entry>dynamic</entry>
1012
	      <entry><option>-XNoDisambiguateRecordFields</option></entry>
1013
1014
	    </row>
	    <row>
1015
	      <entry><option>-XUnboxedTuples</option></entry>
1016
1017
	      <entry>Enable <link linkend="unboxed-tuples">unboxed tuples</link>.</entry>
	      <entry>dynamic</entry>
1018
	      <entry><option>-XNoUnboxedTuples</option></entry>
1019
1020
	    </row>
	    <row>
1021
	      <entry><option>-XStandaloneDeriving</option></entry>
1022
	      <entry>Enable <link linkend="stand-alone-deriving">standalone deriving</link>.</entry>
1023
	      <entry>dynamic</entry>
1024
	      <entry><option>-XNoStandaloneDeriving</option></entry>
1025
1026
	    </row>
	    <row>
1027
	      <entry><option>-XDeriveDataTypeable</option></entry>
1028
	      <entry>Enable <link linkend="deriving-typeable">deriving for the Data and Typeable classes</link>.</entry>
1029
	      <entry>dynamic</entry>
1030
	      <entry><option>-XNoDeriveDataTypeable</option></entry>
1031
	    </row>
1032
	    <row>
1033
1034
	      <entry><option>-XDeriveGeneric</option></entry>
	      <entry>Enable <link linkend="deriving-typeable">deriving for the Generic class</link>.</entry>
1035
	      <entry>dynamic</entry>
1036
	      <entry><option>-XNoDeriveGeneric</option></entry>
1037
	    </row>
1038
1039
1040
1041
1042
1043
	    <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>
1044
	    <row>
1045
	      <entry><option>-XTypeSynonymInstances</option></entry>
1046
	      <entry>Enable <link linkend="flexible-instance-head">type synonyms in instance heads</link>.</entry>
1047
	      <entry>dynamic</entry>
1048
	      <entry><option>-XNoTypeSynonymInstances</option></entry>
1049