1GHC(1)                     Glasgow Haskell Compiler                     GHC(1)
2
3
4

NAME

6       GHC - the Glasgow Haskell Compiler
7
8
9

SYNOPSIS

11       ghc [option|filename]...
12       ghci [option|filename]...
13
14

DESCRIPTION

16       This  manual  page  documents  briefly the ghc and ghci commands.  Note
17       that ghci is not yet available on all architectures.   Extensive  docu‐
18       mentation  is  available  in various other formats including DVI, Post‐
19       Script and HTML; see below.
20
21
22       Each of GHC's command line options is classified as  either  static  or
23       dynamic.   A  static  flag  may  only be specified on the command line,
24       whereas a dynamic flag may also be given in  an  OPTIONS  pragma  in  a
25       source file or set from the GHCi command-line with :set.
26
27       As  a  rule  of thumb, all the language options are dynamic, as are the
28       warning options and the debugging options.
29
30       The rest are static, with the notable exceptions of  -v,  -cpp,  -fasm,
31       -fvia-C,  and -#include.  The OPTIONS sections lists the status of each
32       flag.
33
34
35       Common suffixes of file names for Haskell are:
36
37       .hs    Haskell source code; preprocess, compile
38
39       .lhs   literate Haskell source; unlit, preprocess, compile
40
41       .hi    Interface file; contains information about exported symbols
42
43       .hc    intermediate C files
44
45       .x_o   way x object files; common ways are: p, u, s
46
47       .x_hi  way x interface files
48
49
50

OPTIONS

52   Help and verbosity options
53       -?  -help  -n  -v  -vn  -V   --supported-languages   --info   --version
54       --numeric-version  --print-libdir  -ferror-spans  -Hsize  -Rghc-timing
55
56
57   Which phases to run
58       -E  -C  -S  -c  -x suffix
59
60
61   Alternative modes of operation
62       --interactive  --make  -e expr  -M
63
64
65   Redirecting output
66       -hcsuf  suffix  -hidir dir  -hisuf suffix  -o filename  -odir dir  -ohi
67       filename   -osuf suffix  -stubdir dir  -outputdir dir
68
69
70   Keeping intermediate files
71       -keep-hc-file or
72                        -keep-hc-files  -keep-s-file or
73                        -keep-s-files  -keep-raw-s-file or
74                        -keep-raw-s-files  -keep-tmp-files
75
76
77   Temporary files
78       -tmpdir
79
80
81   Finding imports
82       -idir1:dir2:...  -i
83
84
85   Interface file options
86       -ddump-hi  -ddump-hi-diffs  -ddump-minimal-imports  --show-iface file
87
88
89   Recompilation checking
90       -fforce-recomp -fno-force-recomp
91
92
93   Interactive-mode options
94       -ignore-dot-ghci          -read-dot-ghci           -fbreak-on-exception
95       -fno-break-on-exception       -fbreak-on-error      -fno-break-on-error
96       -fprint-evld-with-show  -fno-print-evld-with-show   -fprint-bind-result
97       -fno-print-bind-result                         -fno-print-bind-contents
98       -fno-implicit-import-qualified
99
100
101   Packages
102       -package-name P  -package  P   -hide-all-packages   -hide-package  name
103       -ignore-package   name    -package-conf   file    -no-user-package-conf
104       -no-auto-link-packages
105
106
107   Language options
108       -fglasgow-exts        -fno-glasgow-exts          -XOverlappingInstances
109       -XNoOverlappingInstances  -XIncoherentInstances -XNoIncoherentInstances
110       -XUndecidableInstances   -XNoUndecidableInstances    -fcontext-stack=Nn
111       -XArrows             -XNoArrows              -XDisambiguateRecordFields
112       -XNoDisambiguateRecordFields                 -XForeignFunctionInterface
113       -XNoForeignFunctionInterface  -XGenerics -XNoGenerics  -XImplicitParams
114       -XNoImplicitParams     -firrefutable-tuples     -fno-irrefutable-tuples
115       -XNoImplicitPrelude    -XImplicitPrelude    -XNoMonomorphismRestriction
116       -XMonomorphismRrestriction      -XNoNPlusKPatterns     -XNPlusKPatterns
117       -XNoMonoPatBinds  -XMonoPatBinds   -XRelaxedPolyRec  -XNoRelaxedPolyRec
118       -XExtendedDefaultRules  -XNoExtendedDefaultRules    -XOverloadedStrings
119       -XNoOverloadedStrings       -XGADTs      -XNoGADTs       -XTypeFamilies
120       -XNoTypeFamilies      -XScopedTypeVariables     -XNoScopedTypeVariables
121       -XMonoLocalBinds          -XNoMonoLocalBinds          -XTemplateHaskell
122       -XNoTemplateHaskell   -XQuasiQuotes   -XNoQuasiQuotes    -XBangPatterns
123       -XNoBangPatterns    -XCPP  -XNoCPP   -XPatternGuards  -XNoPatternGuards
124       -XViewPatterns  -XNoViewPatterns    -XUnicodeSyntax   -XNoUnicodeSyntax
125       -XMagicHash            -XNoMagicHash            -XNewQualifiedOperators
126       -XNoNewQualifiedOperators      -XExplicitForALl      -XNoExplicitForAll
127       -XPolymorphicComponents     -XNoPolymorphicComponents      -XRank2Types
128       -XNoRank2Types    -XRankNTypes   -XNoRankNTypes    -XImpredicativeTypes
129       -XNoImpredicativeTypes                      -XExistentialQuantification
130       -XNoExistentialQuantification    -XKindSignatures    -XNoKindSignatures
131       -XEmptyDataDecls         -XNoEmptyDataDecls          -XParallelListComp
132       -XNoParallelListComp      -XTransformListComp     -XNoTransformListComp
133       -XUnliftedFFITypes      -XNoUnliftedFFITypes      -XLiberalTypeSynonyms
134       -XNoLiberalTypeSynonyms   -XTypeOperators  -XNoTypeOperators    -XDoRec
135       -XNoDoRec      -XRecursiveDo     -XNoRecursiveDo     -XPArr    -XNoPArr
136       -XRecordWildCards         -XNoRecordWildCards          -XNamedFieldPuns
137       -XNoNamedFieldPuns                           -XDisambiguateRecordFields
138       -XNoDisambiguateRecordFields      -XUnboxedTuples     -XNoUnboxedTuples
139       -XStandaloneDeriving    -XNoStandaloneDeriving     -XDeriveDataTypeable
140       -XNoDeriveDataTypeable                     -XGeneralizedNewtypeDeriving
141       -XNoGeneralizedNewtypeDeriving                   -XTypeSynonymInstances
142       -XNoTypeSynonymInstances     -XFlexibleContexts    -XNoFlexibleContexts
143       -XFlexibleInstances   -XNoFlexibleInstances   -XConstrainedClassMethods
144       -XNoConstrainedClassMethods                     -XMultiParamTypeClasses
145       -XNoMultiParamTypeClasses                      -XFunctionalDependencies
146       -XNoFunctionalDependencies  -XPackageImports -XNoPackageImports
147
148
149   Warnings
150       -W -w  -w  -Wall  -w   -Werror    -Wwarn    -fwarn-unrecognised-pragmas
151       -fno-warn-unrecognised-pragmas             -fwarn-warnings-deprecations
152       -fno-warn-warnings-deprecations                 -fwarn-deprecated-flags
153       -fno-warn-deprecated-flags                     -fwarn-duplicate-exports
154       -fno-warn-duplicate-exports  -fwarn-hi-shadowing -fno-warn-hi-shadowing
155       -fwarn-implicit-prelude                      -fno-warn-implicit-prelude
156       -fwarn-incomplete-patterns                -fno-warn-incomplete-patterns
157       -fwarn-incomplete-record-updates    -fno-warn-incomplete-record-updates
158       -fwarn-missing-fields -fno-warn-missing-fields   -fwarn-missing-methods
159       -fno-warn-missing-methods                     -fwarn-missing-signatures
160       -fno-warn-missing-signatures                      -fwarn-name-shadowing
161       -fno-warn-name-shadowing         -fwarn-orphans       -fno-warn-orphans
162       -fwarn-overlapping-patterns              -fno-warn-overlapping-patterns
163       -fwarn-simple-patterns      -fno-warn-simple-patterns       -fwarn-tabs
164       -fno-warn-tabs       -fwarn-type-defaults       -fno-warn-type-defaults
165       -fwarn-monomorphism-restriction      -fno-warn-monomorphism-restriction
166       -fwarn-unused-binds    -fno-warn-unused-binds     -fwarn-unused-imports
167       -fno-warn-unused-imports                          -fwarn-unused-matches
168       -fno-warn-unused-matches                          -fwarn-unused-do-bind
169       -fno-warn-unused-do-bind  -fwarn-wrong-do-bind -fno-warn-wrong-do-bind
170
171
172   Optimisation levels
173       -O -O0  -On -O0
174
175
176   Individual optimisations
177       -fcase-merge    -fno-case-merge     -fdicts-strict    -fno-dicts-strict
178       -fmethod-sharing        -fno-method-sharing          -fdo-eta-reduction
179       -fno-do-eta-reduction                         -fdo-lambda-eta-expansion
180       -fno-do-lambda-eta-expansion  -fexcess-precision  -fno-excess-precision
181       -fignore-asserts     -fno-ignore-asserts     -fignore-interface-pragmas
182       -fno-ignore-interface-pragmas                  -fomit-interface-pragmas
183       -fno-omit-interface-pragmas    -fmax-worker-args    -fsimplifier-phases
184       -fmax-simplifier-iterations  -fno-state-hack   -fcse    -ffull-laziness
185       -frewrite-rules    -fno-rewrite-rules    -fstrictness     -fspec-constr
186       -fspec-constr-threshold=n                    -fno-spec-constr-threshold
187       -fspec-constr-count=n      -fno-spec-constr-count       -fliberate-case
188       -fstatic-argument-transformation            -fliberate-case-threshold=n
189       -fno-liberate-case-threshold                      -funbox-strict-fields
190       -fno-unbox-strict-fields                 -funfolding-creation-threshold
191       -fno-unfolding-creation-threshold              -funfolding-fun-discount
192       -fno-unfolding-fun-discount                  -funfolding-keeness-factor
193       -fno-unfolding-keeness-factor                 -funfolding-use-threshold
194       -fno-unfolding-use-threshold  -fno-pre-inlining  -feager-blackholing
195
196
197   Profiling options
198       -auto -no-auto  -auto-all  -no-auto-all   -caf-all  -no-caf-all   -prof
199       -ticky
200
201
202   Program coverage options
203       -fhpc  -hpcdir dir
204
205
206   Haskell pre-processor options
207       -F
208
209
210   C pre-processor options
211       -cpp  -Dsymbol=value -U  -Usymbol  -Idir
212
213
214   Code generation options
215       -fasm   -fvia-C   -fno-code  -fbyte-code  -fobject-code
216
217
218   Linking options
219       -shared   -fPIC   -dynamic   -dynload  -framework name  -framework-path
220       name   -llib   -Ldir    -main-is    --mk-dll    -no-hs-main    -no-link
221       -split-objs   -static   -threaded  -debug  -eventlog  -fno-gen-manifest
222       -fno-embed-manifest  -fno-shared-implib
223
224
225   Replacing phases
226       -pgmL cmd  -pgmP cmd  -pgmc cmd  -pgmm cmd  -pgms cmd  -pgma cmd  -pgml
227       cmd  -pgmdll cmd  -pgmF cmd  -pgmwindres cmd
228
229
230   Forcing options to particular phases
231       -optL  option   -optP  option  -optF option  -optc option  -optm option
232       -opta option  -optl option  -optdll option  -optwindres option
233
234
235   Platform-specific options
236       -monly-[432]-regs
237
238
239   External core file options
240       -fext-core
241
242
243   Compiler debugging options
244       -dcore-lint   -ddump-asm    -ddump-bcos    -ddump-cmm    -ddump-cpranal
245       -ddump-cse    -ddump-deriv    -ddump-ds   -ddump-flatC   -ddump-foreign
246       -ddump-hpc    -ddump-inlinings     -ddump-occur-anal     -ddump-opt-cmm
247       -ddump-parsed    -ddump-prep    -ddump-rn   -ddump-rules   -ddump-simpl
248       -ddump-simpl-phases         -ddump-simpl-iterations         -ddump-spec
249       -ddump-splices   -ddump-stg   -ddump-stranal   -ddump-tc   -ddump-types
250       -ddump-worker-wrapper          -ddump-if-trace          -ddump-tc-trace
251       -ddump-rn-trace  -ddump-rn-stats  -ddump-simpl-stats  -dno-debug-output
252       -dppr-debug    -dsuppress-uniques    -dppr-noprags    -dppr-user-length
253       -dsource-stats         -dcmm-lint         -dstg-lint        -dstg-stats
254       -dverbose-core2core           -dverbose-stg2stg           -dshow-passes
255       -dfaststring-stats
256
257
258   Misc compiler options
259       -fno-hi-version-check          -dno-black-holing         -fhistory-size
260       -funregisterised  -fno-asm-mangling
261
262
263

HELP AND VERBOSITY OPTIONS

265       -?     help
266                                                                        [mode]
267
268
269       -help  help
270                                                                        [mode]
271
272
273       -n     do a dry run
274                                                                     [dynamic]
275
276
277       -v     verbose mode (equivalent to -v3)
278                                                                     [dynamic]
279
280
281       -vn    set verbosity level
282                                                                     [dynamic]
283
284
285       -V     display GHC version
286                                                                        [mode]
287
288
289       --supported-languages
290              display the supported language extensions
291                                                                        [mode]
292
293
294       --info display information about the compiler
295                                                                        [mode]
296
297
298       --version
299              display GHC version
300                                                                        [mode]
301
302
303       --numeric-version
304              display GHC version (numeric only)
305                                                                        [mode]
306
307
308       --print-libdir
309              display GHC library directory
310                                                                        [mode]
311
312
313       -ferror-spans
314              output full span in error messages
315                                                                      [static]
316
317
318       -Hsize Set the minimum heap size to size
319                                                                      [static]
320
321
322       -Rghc-timing
323              Summarise timing stats for GHC (same as +RTS -tstderr)
324                                                                      [static]
325
326
327

WHICH PHASES TO RUN

329       -E     Stop after preprocessing (.hspp file)
330                                                                        [mode]
331
332
333       -C     Stop after generating C (.hc file)
334                                                                        [mode]
335
336
337       -S     Stop after generating assembly (.s file)
338                                                                        [mode]
339
340
341       -c     Do not link
342                                                                     [dynamic]
343
344
345       -x suffix
346              Override default behaviour for source files
347                                                                      [static]
348
349
350

ALTERNATIVE MODES OF OPERATION

352       --interactive
353              Interactive mode - normally used by just running ghci;  see  for
354              details.
355                                                                        [mode]
356
357
358       --make Build a multi-module Haskell program, automatically figuring out
359              dependencies. Likely to be much easier, and faster,  than  using
360              make; see for details..
361                                                                        [mode]
362
363
364       -e expr
365              Evaluate expr; see for details.
366                                                                        [mode]
367
368
369       -M     Generate  dependency information suitable for use in a Makefile;
370              see for details.
371                                                                        [mode]
372
373
374

REDIRECTING OUTPUT

376       -hcsuf suffix
377              set the suffix to use for intermediate C files
378                                                                     [dynamic]
379
380
381       -hidir dir
382              set directory for interface files
383                                                                     [dynamic]
384
385
386       -hisuf suffix
387              set the suffix to use for interface files
388                                                                     [dynamic]
389
390
391       -o filename
392              set output filename
393                                                                     [dynamic]
394
395
396       -odir dir
397              set directory for object files
398                                                                     [dynamic]
399
400
401       -ohi filename
402              set the filename in which to put the interface
403                                                                     [dynamic]
404
405
406       -osuf suffix
407              set the output file suffix
408                                                                     [dynamic]
409
410
411       -stubdir dir
412              redirect FFi stub files
413                                                                     [dynamic]
414
415
416       -outputdir dir
417              set output directory
418                                                                     [dynamic]
419
420
421

KEEPING INTERMEDIATE FILES

423       -keep-hc-file or
424                               -keep-hc-files retain intermediate .hc files
425                                                                     [dynamic]
426
427
428       -keep-s-file or
429                               -keep-s-files retain intermediate .s files
430                                                                     [dynamic]
431
432
433       -keep-raw-s-file or
434                               -keep-raw-s-files  retain  intermediate  .raw_s
435              files
436                                                                     [dynamic]
437
438
439       -keep-tmp-files
440              retain all intermediate temporary files
441                                                                     [dynamic]
442
443
444

TEMPORARY FILES

446       -tmpdir
447              set the directory for temporary files
448                                                                     [dynamic]
449
450
451

FINDING IMPORTS

453       -idir1:dir2:...
454              add dir, dir2, etc. to import path
455                                                                 [static/:set]
456
457
458       -i     Empty the import directory list
459                                                                 [static/:set]
460
461
462

INTERFACE FILE OPTIONS

464       -ddump-hi
465              Dump the new interface to stdout
466                                                                     [dynamic]
467
468
469       -ddump-hi-diffs
470              Show the differences vs. the old interface
471                                                                     [dynamic]
472
473
474       -ddump-minimal-imports
475              Dump a minimal set of imports
476                                                                     [dynamic]
477
478
479       --show-iface file
480              See .
481                                                                            []
482
483
484

RECOMPILATION CHECKING

486       -fforce-recomp
487              Turn off recompilation checking; implied by any -ddump-X option
488                                                                     [dynamic]
489
490
491

INTERACTIVE-MODE OPTIONS

493       -ignore-dot-ghci
494              Disable reading of .ghci files
495                                                                      [static]
496
497
498       -read-dot-ghci
499              Enable reading of .ghci files
500                                                                      [static]
501
502
503       -fbreak-on-exception
504              Break on any exception thrown
505                                                                     [dynamic]
506
507
508       -fbreak-on-error
509              Break on uncaught exceptions and errors
510                                                                     [dynamic]
511
512
513       -fprint-evld-with-show
514              Enable usage of Show instances in :print
515                                                                     [dynamic]
516
517
518       -fprint-bind-result
519              Turn on printing of binding results in GHCi
520                                                                     [dynamic]
521
522
523       -fno-print-bind-contents
524              Turn off printing of binding contents in GHCi
525                                                                     [dynamic]
526
527
528       -fno-implicit-import-qualified
529              Turn off implicit qualified import of everything in GHCi
530                                                                     [dynamic]
531
532
533

PACKAGES

535       -package-name P
536              Compile to be part of package P
537                                                                     [dynamic]
538
539
540       -package P
541              Expose package P
542                                                                 [static/:set]
543
544
545       -hide-all-packages
546              Hide all packages by default
547                                                                      [static]
548
549
550       -hide-package name
551              Hide package P
552                                                                 [static/:set]
553
554
555       -ignore-package name
556              Ignore package P
557                                                                 [static/:set]
558
559
560       -package-conf file
561              Load more packages from file
562                                                                      [static]
563
564
565       -no-user-package-conf
566              Don't load the user's package config file.
567                                                                      [static]
568
569
570       -no-auto-link-packages
571              Don't automatically link in the haskell98 package.
572                                                                     [dynamic]
573
574
575

LANGUAGE OPTIONS

577       -fglasgow-exts
578              Enable most language extensions
579                                                                     [dynamic]
580
581
582       -XOverlappingInstances
583              Enable overlapping instances
584                                                                     [dynamic]
585
586
587       -XIncoherentInstances
588              Enable incoherent instances. Implies -XOverlappingInstances
589                                                                     [dynamic]
590
591
592       -XUndecidableInstances
593              Enable undecidable instances
594                                                                     [dynamic]
595
596
597       -fcontext-stack=Nn
598              set the limit for context reduction. Default is 20.
599                                                                     [dynamic]
600
601
602       -XArrows
603              Enable arrow notation extension
604                                                                     [dynamic]
605
606
607       -XDisambiguateRecordFields
608              Enable record field disambiguation
609                                                                     [dynamic]
610
611
612       -XForeignFunctionInterface
613              Enable foreign function interface (implied by -fglasgow-exts)
614                                                                     [dynamic]
615
616
617       -XGenerics
618              Enable generic classes
619                                                                     [dynamic]
620
621
622       -XImplicitParams
623              Enable Implicit Parameters. Implied by -fglasgow-exts.
624                                                                     [dynamic]
625
626
627       -firrefutable-tuples
628              Make tuple pattern matching irrefutable
629                                                                     [dynamic]
630
631
632       -XNoImplicitPrelude
633              Don't implicitly import Prelude
634                                                                     [dynamic]
635
636
637       -XNoMonomorphismRestriction
638              Disable the monomorphism restriction
639                                                                     [dynamic]
640
641
642       -XNoNPlusKPatterns
643              Disable support for n+k patterns
644                                                                     [dynamic]
645
646
647       -XNoMonoPatBinds
648              Make pattern bindings polymorphic
649                                                                     [dynamic]
650
651
652       -XRelaxedPolyRec
653              Relaxed checking for mutually-recursive polymorphic functions
654                                                                     [dynamic]
655
656
657       -XExtendedDefaultRules
658              Use GHCi's extended default rules in a normal module
659                                                                     [dynamic]
660
661
662       -XOverloadedStrings
663              Enable overloaded string literals.
664                                                                     [dynamic]
665
666
667       -XGADTs
668              Enable generalised algebraic data types.
669                                                                     [dynamic]
670
671
672       -XTypeFamilies
673              Enable type families.
674                                                                     [dynamic]
675
676
677       -XScopedTypeVariables
678              Enable  lexically-scoped  type  variables.  Implied  by  -fglas‐
679              gow-exts.
680                                                                     [dynamic]
681
682
683       -XMonoLocalBinds
684              Enable do not generalise local bindings.
685                                                                     [dynamic]
686
687
688       -XTemplateHaskell
689              Enable Template Haskell. No longer implied by -fglasgow-exts.
690                                                                     [dynamic]
691
692
693       -XQuasiQuotes
694              Enable quasiquotation.
695                                                                     [dynamic]
696
697
698       -XBangPatterns
699              Enable bang patterns.
700                                                                     [dynamic]
701
702
703       -XCPP  Enable the C preprocessor.
704                                                                     [dynamic]
705
706
707       -XPatternGuards
708              Enable pattern guards.
709                                                                     [dynamic]
710
711
712       -XViewPatterns
713              Enable view patterns.
714                                                                     [dynamic]
715
716
717       -XUnicodeSyntax
718              Enable unicode syntax.
719                                                                     [dynamic]
720
721
722       -XMagicHash
723              Allow "#" as a postfix modifier on identifiers.
724                                                                     [dynamic]
725
726
727       -XNewQualifiedOperators
728              Enable new qualified operator syntax
729                                                                     [dynamic]
730
731
732       -XExplicitForALl
733              Enable explicit universal quantification. Implied  by  -XScoped‐
734              TypeVariables,   -XLiberalTypeSynonyms,  -XRank2Types,  -XRankN‐
735              Types, -XPolymorphicComponents, -XExistentialQuantification
736                                                                     [dynamic]
737
738
739       -XPolymorphicComponents
740              Enable polymorphic components for data constructors.
741                                                                     [dynamic]
742
743
744       -XRank2Types
745              Enable rank-2 types.
746                                                                     [dynamic]
747
748
749       -XRankNTypes
750              Enable rank-N types.
751                                                                     [dynamic]
752
753
754       -XImpredicativeTypes
755              Enable impredicative types.
756                                                                     [dynamic]
757
758
759       -XExistentialQuantification
760              Enable existential quantification.
761                                                                     [dynamic]
762
763
764       -XKindSignatures
765              Enable kind signatures.
766                                                                     [dynamic]
767
768
769       -XEmptyDataDecls
770              Enable empty data declarations.
771                                                                     [dynamic]
772
773
774       -XParallelListComp
775              Enable parallel list comprehensions.
776                                                                     [dynamic]
777
778
779       -XTransformListComp
780              Enable generalised list comprehensions.
781                                                                     [dynamic]
782
783
784       -XUnliftedFFITypes
785              Enable unlifted FFI types.
786                                                                     [dynamic]
787
788
789       -XLiberalTypeSynonyms
790              Enable liberalised type synonyms.
791                                                                     [dynamic]
792
793
794       -XTypeOperators
795              Enable type operators.
796                                                                     [dynamic]
797
798
799       -XDoRec
800              Enable recursive do notation.
801                                                                     [dynamic]
802
803
804       -XRecursiveDo
805              Enable recursive do (mdo) notation. This is  deprecated;  please
806              use recursive do notation instead.
807                                                                     [dynamic]
808
809
810       -XPArr Enable parallel arrays.
811                                                                     [dynamic]
812
813
814       -XRecordWildCards
815              Enable record wildcards.
816                                                                     [dynamic]
817
818
819       -XNamedFieldPuns
820              Enable record puns.
821                                                                     [dynamic]
822
823
824       -XDisambiguateRecordFields
825              Enable record field disambiguation.
826                                                                     [dynamic]
827
828
829       -XUnboxedTuples
830              Enable unboxed tuples.
831                                                                     [dynamic]
832
833
834       -XStandaloneDeriving
835              Enable standalone deriving.
836                                                                     [dynamic]
837
838
839       -XDeriveDataTypeable
840              Enable deriving for the Data and Typeable classes.
841                                                                     [dynamic]
842
843
844       -XGeneralizedNewtypeDeriving
845              Enable newtype deriving.
846                                                                     [dynamic]
847
848
849       -XTypeSynonymInstances
850              Enable type synonyms in instance heads.
851                                                                     [dynamic]
852
853
854       -XFlexibleContexts
855              Enable flexible contexts.
856                                                                     [dynamic]
857
858
859       -XFlexibleInstances
860              Enable flexible instances.
861                                                                     [dynamic]
862
863
864       -XConstrainedClassMethods
865              Enable constrained class methods.
866                                                                     [dynamic]
867
868
869       -XMultiParamTypeClasses
870              Enable multi parameter type classes.
871                                                                     [dynamic]
872
873
874       -XFunctionalDependencies
875              Enable functional dependencies.
876                                                                     [dynamic]
877
878
879       -XPackageImports
880              Enable package-qualified imports.
881                                                                     [dynamic]
882
883
884

WARNINGS

886       -W     enable normal warnings
887                                                                     [dynamic]
888
889
890       -w     disable all warnings
891                                                                     [dynamic]
892
893
894       -Wall  enable almost all warnings (details in )
895                                                                     [dynamic]
896
897
898       -Werror
899              make warnings fatal
900                                                                     [dynamic]
901
902
903       -Wwarn make warnings non-fatal
904                                                                     [dynamic]
905
906
907       -fwarn-unrecognised-pragmas
908              warn about uses of pragmas that GHC doesn't recognise
909                                                                     [dynamic]
910
911
912       -fwarn-warnings-deprecations
913              warn  about uses of functions & types that have warnings or dep‐
914              recated pragmas
915                                                                     [dynamic]
916
917
918       -fwarn-deprecated-flags
919              warn about uses of commandline flags that are deprecated
920                                                                     [dynamic]
921
922
923       -fwarn-duplicate-exports
924              warn when an entity is exported multiple times
925                                                                     [dynamic]
926
927
928       -fwarn-hi-shadowing
929              warn when a .hi file in the current directory shadows a library
930                                                                     [dynamic]
931
932
933       -fwarn-implicit-prelude
934              warn when the Prelude is implicitly imported
935                                                                     [dynamic]
936
937
938       -fwarn-incomplete-patterns
939              warn when a pattern match could fail
940                                                                     [dynamic]
941
942
943       -fwarn-incomplete-record-updates
944              warn when a record update could fail
945                                                                     [dynamic]
946
947
948       -fwarn-missing-fields
949              warn when fields of a record are uninitialised
950                                                                     [dynamic]
951
952
953       -fwarn-missing-methods
954              warn when class methods are undefined
955                                                                     [dynamic]
956
957
958       -fwarn-missing-signatures
959              warn about top-level functions without signatures
960                                                                     [dynamic]
961
962
963       -fwarn-name-shadowing
964              warn when names are shadowed
965                                                                     [dynamic]
966
967
968       -fwarn-orphans
969              warn when the module contains orphan  instance  declarations  or
970              rewrite rules
971                                                                     [dynamic]
972
973
974       -fwarn-overlapping-patterns
975              warn about overlapping patterns
976                                                                     [dynamic]
977
978
979       -fwarn-simple-patterns
980              warn about lambda-patterns that can fail
981                                                                     [dynamic]
982
983
984       -fwarn-tabs
985              warn if there are tabs in the source file
986                                                                     [dynamic]
987
988
989       -fwarn-type-defaults
990              warn when defaulting happens
991                                                                     [dynamic]
992
993
994       -fwarn-monomorphism-restriction
995              warn when the Monomorphism Restriction is applied
996                                                                     [dynamic]
997
998
999       -fwarn-unused-binds
1000              warn about bindings that are unused
1001                                                                     [dynamic]
1002
1003
1004       -fwarn-unused-imports
1005              warn about unnecessary imports
1006                                                                     [dynamic]
1007
1008
1009       -fwarn-unused-matches
1010              warn about variables in patterns that aren't used
1011                                                                     [dynamic]
1012
1013
1014       -fwarn-unused-do-bind
1015              warn about do bindings that appear to throw away values of types
1016              other than ()
1017                                                                     [dynamic]
1018
1019
1020       -fwarn-wrong-do-bind
1021              warn about do bindings that appear to throw away monadic  values
1022              that you should have bound instead
1023                                                                     [dynamic]
1024
1025
1026

OPTIMISATION LEVELS

1028       -O     Enable default optimisation (level 1)
1029                                                                     [dynamic]
1030
1031
1032       -On    Set optimisation level n
1033                                                                     [dynamic]
1034
1035
1036

INDIVIDUAL OPTIMISATIONS

1038       -fcase-merge
1039              Enable case-merging. Implied by -O.
1040                                                                     [dynamic]
1041
1042
1043       -fdicts-strict
1044              Make dictionaries strict
1045                                                                      [static]
1046
1047
1048       -fmethod-sharing
1049              Share specialisations of overloaded functions (default)
1050                                                                     [dynamic]
1051
1052
1053       -fdo-eta-reduction
1054              Enable eta-reduction. Implied by -O.
1055                                                                     [dynamic]
1056
1057
1058       -fdo-lambda-eta-expansion
1059              Enable lambda eta-reduction
1060                                                                     [dynamic]
1061
1062
1063       -fexcess-precision
1064              Enable excess intermediate precision
1065                                                                     [dynamic]
1066
1067
1068       -fignore-asserts
1069              Ignore assertions in the source
1070                                                                     [dynamic]
1071
1072
1073       -fignore-interface-pragmas
1074              Ignore pragmas in interface files
1075                                                                     [dynamic]
1076
1077
1078       -fomit-interface-pragmas
1079              Don't generate interface pragmas
1080                                                                     [dynamic]
1081
1082
1083       -fmax-worker-args
1084              If  a worker has that many arguments, none will be unpacked any‐
1085              more (default: 10)
1086                                                                      [static]
1087
1088
1089       -fsimplifier-phases
1090              Set the number of phases for the simplifier (default 2). Ignored
1091              with -O0.
1092                                                                     [dynamic]
1093
1094
1095       -fmax-simplifier-iterations
1096              Set the max iterations for the simplifier
1097                                                                     [dynamic]
1098
1099
1100       -fno-state-hack
1101              Turn  off  the "state hack" whereby any lambda with a real-world
1102              state token as argument is considered to be single-entry.  Hence
1103              OK to inline things inside it.
1104                                                                      [static]
1105
1106
1107       -fcse  Turn on common sub-expression elimination. Implied by -O.
1108                                                                     [dynamic]
1109
1110
1111       -ffull-laziness
1112              Turn  on  full laziness (floating bindings outwards). Implied by
1113              -O.
1114                                                                     [dynamic]
1115
1116
1117       -frewrite-rules
1118              Switch on all rewrite rules (including rules generated by  auto‐
1119              matic specialisation of overloaded functions). Implied by -O.
1120                                                                     [dynamic]
1121
1122
1123       -fstrictness
1124              Turn on strictness analysis. Implied by -O.
1125                                                                     [dynamic]
1126
1127
1128       -fspec-constr
1129              Turn on the SpecConstr transformation. Implied by -O2.
1130                                                                     [dynamic]
1131
1132
1133       -fspec-constr-threshold=n
1134              Set  the  size  threshold for the SpecConstr transformation to n
1135              (default: 200)
1136                                                                      [static]
1137
1138
1139       -fspec-constr-count=n
1140              Set to n (default: 3) the maximum number of specialisations that
1141              will be created for any one function by the SpecConstr transfor‐
1142              mation
1143                                                                      [static]
1144
1145
1146       -fliberate-case
1147              Turn on the liberate-case transformation. Implied by -O2.
1148                                                                     [dynamic]
1149
1150
1151       -fstatic-argument-transformation
1152              Turn on the static argument transformation. Implied by -O2.
1153                                                                     [dynamic]
1154
1155
1156       -fliberate-case-threshold=n
1157              Set the size threshold for the liberate-case transformation to n
1158              (default: 200)
1159                                                                      [static]
1160
1161
1162       -funbox-strict-fields
1163              Flatten strict constructor fields
1164                                                                     [dynamic]
1165
1166
1167       -funfolding-creation-threshold
1168              Tweak unfolding settings
1169                                                                      [static]
1170
1171
1172       -funfolding-fun-discount
1173              Tweak unfolding settings
1174                                                                      [static]
1175
1176
1177       -funfolding-keeness-factor
1178              Tweak unfolding settings
1179                                                                      [static]
1180
1181
1182       -funfolding-use-threshold
1183              Tweak unfolding settings
1184                                                                      [static]
1185
1186
1187       -fno-pre-inlining
1188              Turn off pre-inlining
1189                                                                      [static]
1190
1191
1192       -feager-blackholing
1193              Turn on eager blackholing
1194                                                                     [dynamic]
1195
1196
1197

PROFILING OPTIONS

1199       -auto  Auto-add _scc_s to all exported functions
1200                                                                     [dynamic]
1201
1202
1203       -auto-all
1204              Auto-add _scc_s to all top-level functions
1205                                                                     [dynamic]
1206
1207
1208       -caf-all
1209              Auto-add _scc_s to all CAFs
1210                                                                     [dynamic]
1211
1212
1213       -prof  Turn on profiling
1214                                                                      [static]
1215
1216
1217       -ticky Turn on ticky-ticky profiling
1218                                                                      [static]
1219
1220
1221

PROGRAM COVERAGE OPTIONS

1223       -fhpc  Turn on Haskell program coverage instrumentation
1224                                                                      [static]
1225
1226
1227       -hpcdir dir
1228              Directory  to  deposit .mix files during compilation (default is
1229              .hpc)
1230                                                                     [dynamic]
1231
1232
1233

HASKELL PRE-PROCESSOR OPTIONS

1235       -F     Enable the use of a pre-processor (set with -pgmF)
1236                                                                     [dynamic]
1237
1238
1239

C PRE-PROCESSOR OPTIONS

1241       -cpp   Run the C pre-processor on Haskell source files
1242                                                                     [dynamic]
1243
1244
1245       -Dsymbol=value
1246              Define a symbol in the C pre-processor
1247                                                                     [dynamic]
1248
1249
1250       -Usymbol
1251              Undefine a symbol in the C pre-processor
1252                                                                     [dynamic]
1253
1254
1255       -Idir  Add dir to the directory search list for #include files
1256                                                                     [dynamic]
1257
1258
1259

CODE GENERATION OPTIONS

1261       -fasm  Use the native code generator
1262                                                                     [dynamic]
1263
1264
1265       -fvia-C
1266              Compile via C
1267                                                                     [dynamic]
1268
1269
1270       -fno-code
1271              Omit code generation
1272                                                                     [dynamic]
1273
1274
1275       -fbyte-code
1276              Generate byte-code
1277                                                                     [dynamic]
1278
1279
1280       -fobject-code
1281              Generate object code
1282                                                                     [dynamic]
1283
1284
1285

LINKING OPTIONS

1287       -shared
1288              Generate a shared library (as opposed to an executable)
1289                                                                     [dynamic]
1290
1291
1292       -fPIC  Generate position-independent code (where available)
1293                                                                      [static]
1294
1295
1296       -dynamic
1297              Use dynamic Haskell libraries (if available)
1298                                                                      [static]
1299
1300
1301       -dynload
1302              Selects one of a number of modes for finding shared libraries at
1303              runtime.
1304                                                                      [static]
1305
1306
1307       -framework name
1308              On  Darwin/MacOS X only, link in the framework name. This option
1309              corresponds to the -framework option for Apple's Linker.
1310                                                                     [dynamic]
1311
1312
1313       -framework-path name
1314              On Darwin/MacOS X only, add  dir  to  the  list  of  directories
1315              searched  for  frameworks. This option corresponds to the -F op‐
1316              tion for Apple's Linker.
1317                                                                     [dynamic]
1318
1319
1320       -llib  Link in library lib
1321                                                                     [dynamic]
1322
1323
1324       -Ldir  Add dir to the list of directories searched for libraries
1325                                                                     [dynamic]
1326
1327
1328       -main-is
1329              Set main module and function
1330                                                                     [dynamic]
1331
1332
1333       --mk-dll
1334              DLL-creation mode (Windows only)
1335                                                                     [dynamic]
1336
1337
1338       -no-hs-main
1339              Don't assume this program contains main
1340                                                                     [dynamic]
1341
1342
1343       -no-link
1344              Omit linking
1345                                                                     [dynamic]
1346
1347
1348       -split-objs
1349              Split objects (for libraries)
1350                                                                     [dynamic]
1351
1352
1353       -static
1354              Use static Haskell libraries
1355                                                                      [static]
1356
1357
1358       -threaded
1359              Use the threaded runtime
1360                                                                      [static]
1361
1362
1363       -debug Use the debugging runtime
1364                                                                      [static]
1365
1366
1367       -eventlog
1368              Enable runtime event tracing
1369                                                                      [static]
1370
1371
1372       -fno-gen-manifest
1373              Do not generate a manifest file (Windows only)
1374                                                                     [dynamic]
1375
1376
1377       -fno-embed-manifest
1378              Do not embed the manifest in the executable (Windows only)
1379                                                                     [dynamic]
1380
1381
1382       -fno-shared-implib
1383              Don't generate an import library for a DLL (Windows only)
1384                                                                     [dynamic]
1385
1386
1387

REPLACING PHASES

1389       -pgmL cmd
1390              Use cmd as the literate pre-processor
1391                                                                     [dynamic]
1392
1393
1394       -pgmP cmd
1395              Use cmd as the C pre-processor (with -cpp only)
1396                                                                     [dynamic]
1397
1398
1399       -pgmc cmd
1400              Use cmd as the C compiler
1401                                                                     [dynamic]
1402
1403
1404       -pgmm cmd
1405              Use cmd as the mangler
1406                                                                     [dynamic]
1407
1408
1409       -pgms cmd
1410              Use cmd as the splitter
1411                                                                     [dynamic]
1412
1413
1414       -pgma cmd
1415              Use cmd as the assembler
1416                                                                     [dynamic]
1417
1418
1419       -pgml cmd
1420              Use cmd as the linker
1421                                                                     [dynamic]
1422
1423
1424       -pgmdll cmd
1425              Use cmd as the DLL generator
1426                                                                     [dynamic]
1427
1428
1429       -pgmF cmd
1430              Use cmd as the pre-processor (with -F only)
1431                                                                     [dynamic]
1432
1433
1434       -pgmwindres cmd
1435              Use cmd as the program for embedding manifests on Windows.
1436                                                                     [dynamic]
1437
1438
1439

FORCING OPTIONS TO PARTICULAR PHASES

1441       -optL option
1442              pass option to the literate pre-processor
1443                                                                     [dynamic]
1444
1445
1446       -optP option
1447              pass option to cpp (with -cpp only)
1448                                                                     [dynamic]
1449
1450
1451       -optF option
1452              pass option to the custom pre-processor
1453                                                                     [dynamic]
1454
1455
1456       -optc option
1457              pass option to the C compiler
1458                                                                     [dynamic]
1459
1460
1461       -optm option
1462              pass option to the mangler
1463                                                                     [dynamic]
1464
1465
1466       -opta option
1467              pass option to the assembler
1468                                                                     [dynamic]
1469
1470
1471       -optl option
1472              pass option to the linker
1473                                                                     [dynamic]
1474
1475
1476       -optdll option
1477              pass option to the DLL generator
1478                                                                     [dynamic]
1479
1480
1481       -optwindres option
1482              pass option to windres.
1483                                                                     [dynamic]
1484
1485
1486

PLATFORM-SPECIFIC OPTIONS

1488       -monly-[432]-regs
1489              (x86 only) give some registers back to the C compiler
1490                                                                     [dynamic]
1491
1492
1493

EXTERNAL CORE FILE OPTIONS

1495       -fext-core
1496              Generate .hcr external Core files
1497                                                                     [dynamic]
1498
1499
1500

COMPILER DEBUGGING OPTIONS

1502       -dcore-lint
1503              Turn on internal sanity checking
1504                                                                     [dynamic]
1505
1506
1507       -ddump-asm
1508              Dump assembly
1509                                                                     [dynamic]
1510
1511
1512       -ddump-bcos
1513              Dump interpreter byte code
1514                                                                     [dynamic]
1515
1516
1517       -ddump-cmm
1518              Dump C-- output
1519                                                                     [dynamic]
1520
1521
1522       -ddump-cpranal
1523              Dump output from CPR analysis
1524                                                                     [dynamic]
1525
1526
1527       -ddump-cse
1528              Dump CSE output
1529                                                                     [dynamic]
1530
1531
1532       -ddump-deriv
1533              Dump deriving output
1534                                                                     [dynamic]
1535
1536
1537       -ddump-ds
1538              Dump desugarer output
1539                                                                     [dynamic]
1540
1541
1542       -ddump-flatC
1543              Dump `flat' C
1544                                                                     [dynamic]
1545
1546
1547       -ddump-foreign
1548              Dump foreign export stubs
1549                                                                     [dynamic]
1550
1551
1552       -ddump-hpc
1553              Dump after instrumentation for program coverage
1554                                                                     [dynamic]
1555
1556
1557       -ddump-inlinings
1558              Dump inlining info
1559                                                                     [dynamic]
1560
1561
1562       -ddump-occur-anal
1563              Dump occurrence analysis output
1564                                                                     [dynamic]
1565
1566
1567       -ddump-opt-cmm
1568              Dump the results of C-- to C-- optimising passes
1569                                                                     [dynamic]
1570
1571
1572       -ddump-parsed
1573              Dump parse tree
1574                                                                     [dynamic]
1575
1576
1577       -ddump-prep
1578              Dump prepared core
1579                                                                     [dynamic]
1580
1581
1582       -ddump-rn
1583              Dump renamer output
1584                                                                     [dynamic]
1585
1586
1587       -ddump-rules
1588              Dump rules
1589                                                                     [dynamic]
1590
1591
1592       -ddump-simpl
1593              Dump final simplifier output
1594                                                                     [dynamic]
1595
1596
1597       -ddump-simpl-phases
1598              Dump output from each simplifier phase
1599                                                                     [dynamic]
1600
1601
1602       -ddump-simpl-iterations
1603              Dump output from each simplifier iteration
1604                                                                     [dynamic]
1605
1606
1607       -ddump-spec
1608              Dump specialiser output
1609                                                                     [dynamic]
1610
1611
1612       -ddump-splices
1613              Dump TH spliced expressions, and what they evaluate to
1614                                                                     [dynamic]
1615
1616
1617       -ddump-stg
1618              Dump final STG
1619                                                                     [dynamic]
1620
1621
1622       -ddump-stranal
1623              Dump strictness analyser output
1624                                                                     [dynamic]
1625
1626
1627       -ddump-tc
1628              Dump typechecker output
1629                                                                     [dynamic]
1630
1631
1632       -ddump-types
1633              Dump type signatures
1634                                                                     [dynamic]
1635
1636
1637       -ddump-worker-wrapper
1638              Dump worker-wrapper output
1639                                                                     [dynamic]
1640
1641
1642       -ddump-if-trace
1643              Trace interface files
1644                                                                     [dynamic]
1645
1646
1647       -ddump-tc-trace
1648              Trace typechecker
1649                                                                     [dynamic]
1650
1651
1652       -ddump-rn-trace
1653              Trace renamer
1654                                                                     [dynamic]
1655
1656
1657       -ddump-rn-stats
1658              Renamer stats
1659                                                                     [dynamic]
1660
1661
1662       -ddump-simpl-stats
1663              Dump simplifier stats
1664                                                                     [dynamic]
1665
1666
1667       -dno-debug-output
1668              Suppress unsolicited debugging output
1669                                                                      [static]
1670
1671
1672       -dppr-debug
1673              Turn on debug printing (more verbose)
1674                                                                      [static]
1675
1676
1677       -dsuppress-uniques
1678              Suppress the printing of uniques in debug output (easier to  use
1679              diff.
1680                                                                      [static]
1681
1682
1683       -dppr-noprags
1684              Don't output pragma info in dumps
1685                                                                      [static]
1686
1687
1688       -dppr-user-length
1689              Set the depth for printing expressions in error msgs
1690                                                                      [static]
1691
1692
1693       -dsource-stats
1694              Dump haskell source stats
1695                                                                     [dynamic]
1696
1697
1698       -dcmm-lint
1699              C-- pass sanity checking
1700                                                                     [dynamic]
1701
1702
1703       -dstg-lint
1704              STG pass sanity checking
1705                                                                     [dynamic]
1706
1707
1708       -dstg-stats
1709              Dump STG stats
1710                                                                     [dynamic]
1711
1712
1713       -dverbose-core2core
1714              Show output from each core-to-core pass
1715                                                                     [dynamic]
1716
1717
1718       -dverbose-stg2stg
1719              Show output from each STG-to-STG pass
1720                                                                     [dynamic]
1721
1722
1723       -dshow-passes
1724              Print out each pass name as it happens
1725                                                                     [dynamic]
1726
1727
1728       -dfaststring-stats
1729              Show statistics for fast string usage when finished
1730                                                                     [dynamic]
1731
1732
1733

MISC COMPILER OPTIONS

1735       -fno-hi-version-check
1736              Don't complain about .hi file mismatches
1737                                                                      [static]
1738
1739
1740       -dno-black-holing
1741              Turn off black holing (probably doesn't work)
1742                                                                      [static]
1743
1744
1745       -fhistory-size
1746              Set simplification history size
1747                                                                      [static]
1748
1749
1750       -funregisterised
1751              Unregisterised compilation (use -unreg instead)
1752                                                                      [static]
1753
1754
1755       -fno-asm-mangling
1756              Turn off assembly mangling (use -unreg instead)
1757                                                                     [dynamic]
1758
1759
1760
1761

FILES

1763       /usr/lib64
1764
1766       Copyright 2002, The University Court of the University of Glasgow.
1767       All rights reserved.
1768
1769
1770

AUTHOR

1772       This  manual  page was generated from the XML documentation of GHC with
1773       blood, sweat, tears and  a  breaks-if-you-look-at-it-the-wrong-way  XSL
1774       stylesheet  originally  written  by Michael Weber <michaelw@debian.org>
1775       for the Debian GNU/Linux system (but may be used by others).
1776
1777
1778
1779
1780Glasgow FP Suite                  2002-10-25                            GHC(1)
Impressum