man ghc6 (Commandes) - the Glasgow Haskell Compiler

NAME

GHC - the Glasgow Haskell Compiler

SYNOPSIS

ghc [option|filename]...

ghci [option|filename]...

ghc6 [option|filename]...

ghci6 [option|filename]...

DESCRIPTION

This manual page documents briefly the ghc and ghci commands. Extensive documentation is available in various other formats including DVI, PostScript and HTML; see below.

Each of GHC's command line options is classified as either static or dynamic. A static flag may only be specified on the command line, whereas a dynamic flag may also be given in an CROPTIONS pragma in a source file or set from the GHCi command-line with CR:set.

As a rule of thumb, all the language options are dynamic, as are the warning options and the debugging options.

The rest are static, with the notable exceptions of -v, -cpp, -fasm, -fvia-C, and -#include. The OPTIONS sections lists the status of each flag.

Common suffixes of file names for Haskell are:

.hs
Haskell source code; preprocess, compile
.lhs
literate Haskell source; unlit, preprocess, compile
.hi
Interface file; contains information about exported symbols
.hc
intermediate C files
.x_o
way x object files; common ways are: p, u, s
.x_hi
way x interface files

OPTIONS

Help and verbosity options

-? -help -v -vn -V --version --numeric-version --print-libdir -ferror-spans

Which phases to run

-E -C -S -c

Alternative modes of operation

--interactive --make -e expr -M --mk-dll

Redirecting output

-hcsuf suffix -hidir dir -hisuf suffix -o filename -odir dir -ohi filename -osuf suffix

Keeping intermediate files

-keep-hc-file -keep-s-file -keep-raw-s-file -keep-tmp-files

Temporary files

-tmpdir

Finding imports

-idir1:dir2:... -i

Interface file options

-ddump-hi -ddump-hi-diffs -ddump-minimal-imports --show-iface file

Recompilation checking

-no-recomp -recomp

Interactive-mode options

-ignore-dot-ghci -read-dot-ghci

Packages

-package P -hide-all-packages -hide-package name -ignore-package name -package-conf file -no-user-package-conf

Language options

-fallow-overlapping-instances -fno-allow-overlapping-instances -fallow-undecidable-instances -fno-allow-undecidable-instances -fallow-incoherent-instances -fno-allow-incoherent-instances -farrows -fno-arrows -fcontext-stackn -ffi or -fffi -fno-ffi -fgenerics -fno-fgenerics -fglasgow-exts -fno-glasgow-exts -fignore-asserts -fno-ignore-asserts -fimplicit-params -fno-implicit-params -firrefutable-tuples -fno-irrefutable-tuples -fno-implicit-prelude -fimplicit-prelude -fno-monomorphism-restriction -fmonomorphism-restriction -fscoped-type-variables -fno-scoped-type-variables -fth -fno-th

Warnings

-W -w -w -Wall -w -Werror -fwarn-deprecations -fno-warn-deprecations -fwarn-duplicate-exports -fno-warn-duplicate-exports -fwarn-hi-shadowing -fno-warn-hi-shadowing -fwarn-incomplete-patterns -fno-warn-incomplete-patterns -fwarn-incomplete-record-updates -fno-warn-incomplete-record-updates -fwarn-misc -fno-warn-misc -fwarn-missing-fields -fno-warn-missing-fields -fwarn-missing-methods -fno-warn-missing-methods -fwarn-missing-signatures -fno-warn-missing-signatures -fwarn-name-shadowing -fno-warn-name-shadowing -fwarn-oprhans -fno-warn-orphans -fwarn-overlapping-patterns -fno-warn-overlapping-patterns -fwarn-simple-patterns -fno-warn-simple-patterns -fwarn-type-defaults -fno-warn-type-defaults -fwarn-unused-binds -fno-warn-unused-binds -fwarn-unused-imports -fno-warn-unused-imports -fwarn-unused-matches -fno-warn-unused-matches

Optimisation levels

-O -O0 -On -O0

Individual optimisations

-fcase-merge -fno-case-merge -fdicts-strict -fno-dicts-strict -fdo-eta-reduction -fno-do-eta-reduction -fdo-lambda-eta-expansion -fno-do-lambda-eta-expansion -fexcess-precision -fno-excess-precision -frules-off -frules-off -fignore-asserts -fno-ignore-asserts -fignore-interface-pragmas -fno-ignore-interface-pragmas -fliberate-case-threshold -fno-liberate-case-threshold -fomit-interface-pragmas -fno-omit-interface-pragmas -fmax-worker-args -fmax-simplifier-iterations -fno-state-hack -fno-cse -fno-full-laziness -fno-pre-inlining -fno-strictness -funbox-strict-fields -fno-unbox-strict-fields -funfolding-creation-threshold -fno-unfolding-creation-threshold -funfolding-fun-discount -fno-unfolding-fun-discount -funfolding-keeness-factor -fno-unfolding-keeness-factor -funfolding-update-in-place -fno-unfolding-update-in-place -funfolding-use-threshold -fno-unfolding-use-threshold

Profiling options

-auto -no-auto -auto-all -no-auto-all -auto-dicts -no-auto-dicts -caf-all -no-caf-all -prof -ticky

Parallelism options

-gransim -parallel -smp

C pre-processor options

-cpp -Dsymbol=value -U -Usymbol -Idir

C compiler options

-#include file

Code generation options

-fasm -fvia-C -fno-code

Linking options

-dynamic -framework name -framework-path name -llib -Ldir -main-is -no-hs-main -no-link -package name -split-objs -static -threaded -debug

Replacing phases

-pgmL cmd -pgmP cmd -pgmc cmd -pgma cmd -pgml cmd -pgmdll cmd -pgmdep cmd -pgmF cmd

Forcing options to particular phases

-optL option -optP option -optF option -optc option -opta option -optl option -optdll option -optdep option

Platform-specific options

-mv8 -monly-[32]-regs

External core file options

-fext-core

Compiler debugging options

-dcore-lint -ddump-absC -ddump-asm -ddump-bcos -ddump-cpranal -ddump-cse -ddump-deriv -ddump-ds -ddump-flatC -ddump-foreign -ddump-inlinings -ddump-occur-anal -ddump-parsed -ddump-realC -ddump-rn -ddump-rules -ddump-sat -ddump-simpl -ddump-simpl-iterations -ddump-spec -ddump-stg -ddump-stranal -ddump-tc -ddump-types -ddump-usagesp -ddump-worker-wrapper -ddump-rn-trace -ddump-rn-stats -ddump-stix -ddump-simpl-stats -dppr-debug -dppr-noprags -dppr-user-length -dsource-stats -dstg-lint -dstg-stats -dusagesp-lint -dverbose-core2core -dverbose-stg2stg -unreg

Misc compiler options

-femit-extern-decls -fglobalise-toplev-names -fno-hi-version-check -dno-black-holing -fno-method-sharing -fno-prune-decls -fhistory-size -funregisterised -fno-asm-mangling

HELP AND VERBOSITY OPTIONS

-?
help [static]
-help
help [static]
-v
verbose mode (equivalent to -v3) [dynamic]
-vn
set verbosity level [dynamic]
-V
display GHC version [static]
--version
display GHC version [static]
--numeric-version
display GHC version (numeric only) [static]
--print-libdir
display GHC library directory [static]
-ferror-spans
output full span in error messages [static]

WHICH PHASES TO RUN

-E
Stop after preprocessing (CR.hspp file) [static]
-C
Stop after generating C (CR.hc file) [static]
-S
Stop after generating assembly (CR.s file) [static]
-c
Stop after compiling to object code (CR.o file) [static]

ALTERNATIVE MODES OF OPERATION

--interactive
Interactive mode - normally used by just running ghci [static]
--make
Build a multi-module Haskell program, automatically figuring out dependencies. Likely to be much easier, and faster, than using make. [static]
-e expr
Evaluate expr [static]
-M
Generate dependency information suitable for use in a Makefile. [static]
--mk-dll
DLL-creation mode (Windows only) [static]

REDIRECTING OUTPUT

-hcsuf suffix
set the suffix to use for intermediate C files [static]
-hidir dir
set directory for interface files [static]
-hisuf suffix
set the suffix to use for interface files [static]
-o filename
set output filename [static]
-odir dir
set output directory [static]
-ohi filename
set the filename in which to put the interface [static]
-osuf suffix
set the output file suffix [static]

KEEPING INTERMEDIATE FILES

-keep-hc-file
retain intermediate CR.hc files [static]
-keep-s-file
retain intermediate CR.s files [static]
-keep-raw-s-file
retain intermediate CR.raw_s files [static]
-keep-tmp-files
retain all intermediate temporary files [static]

TEMPORARY FILES

-tmpdir
set the directory for temporary files [static]

FINDING IMPORTS

-idir1:dir2:...
add dir, dir2, etc. to import path [static]
-i
Empty the import directory list [static]

INTERFACE FILE OPTIONS

-ddump-hi
Dump the new interface to stdout [dynamic]
-ddump-hi-diffs
Show the differences vs. the old interface [dynamic]
-ddump-minimal-imports
Dump a minimal set of imports [dynamic]
--show-iface file
Read the interface in file and dump it as text to CRstdout. [static]

RECOMPILATION CHECKING

-no-recomp
Turn off recompilation checking; implied by any -ddump-X option [dynamic]

INTERACTIVE-MODE OPTIONS

-ignore-dot-ghci
Disable reading of .ghci files [static]
-read-dot-ghci
Enable reading of .ghci files [static]

PACKAGES

-package P
Expose package P [static]
-hide-all-packages
Hide all packages by default [static]
-hide-package name
Hide package P [static]
-ignore-package name
Ignore package P [static]
-package-conf file
Load more packages from file [static]
-no-user-package-conf
Don't load the user's package config file. [static]

LANGUAGE OPTIONS

-fallow-overlapping-instances
Enable overlapping instances [dynamic]
-fallow-undecidable-instances
Enable undecidable instances [dynamic]
-fallow-incoherent-instances
Enable incoherent instances [dynamic]
-farrows
Enable arrow notation extension [dynamic]
-fcontext-stackn
set the limit for context reduction [static]
-ffi or -fffi
Enable foreign function interface (implied by -fglasgow-exts) [dynamic]
-fgenerics
Enable generics [dynamic]
-fglasgow-exts
Enable most language extensions [dynamic]
-fignore-asserts
Ignore assertions [dynamic]
-fimplicit-params
Enable Implicit Parameters. Implied by -fglasgow-exts. [dynamic]
-firrefutable-tuples
Make tuple pattern matching irrefutable [dynamic]
-fno-implicit-prelude
Don't implicitly CRimport Prelude [dynamic]
-fno-monomorphism-restriction
Disable the monomorphism restriction [dynamic]
-fscoped-type-variables
Enable lexically-scoped type variables. Implied by -fglasgow-exts. [dynamic]
-fth
Enable Template Haskell. Implied by -fglasgow-exts. [dynamic]

WARNINGS

-W
enable normal warnings [dynamic]
-w
disable all warnings [dynamic]
-Wall
enable all warnings [dynamic]
-Werror
make warnings fatal [dynamic]
-fwarn-deprecations
warn about uses of functions & types that are deprecated [dynamic]
-fwarn-duplicate-exports
warn when an entity is exported multiple times [dynamic]
-fwarn-hi-shadowing
warn when a CR.hi file in the current directory shadows a library [dynamic]
-fwarn-incomplete-patterns
warn when a pattern match could fail [dynamic]
-fwarn-incomplete-record-updates
warn when a record update could fail [dynamic]
-fwarn-misc
enable miscellaneous warnings [dynamic]
-fwarn-missing-fields
warn when fields of a record are uninitialised [dynamic]
-fwarn-missing-methods
warn when class methods are undefined [dynamic]
-fwarn-missing-signatures
warn about top-level functions without signatures [dynamic]
-fwarn-name-shadowing
warn when names are shadowed [dynamic]
-fwarn-oprhans
warn when the module contains "orphan" instance declarations or rewrite rules [dynamic]
-fwarn-overlapping-patterns
warn about overlapping patterns [dynamic]
-fwarn-simple-patterns
warn about lambda-patterns that can fail [dynamic]
-fwarn-type-defaults
warn when defaulting happens [dynamic]
-fwarn-unused-binds
warn about bindings that are unused [dynamic]
-fwarn-unused-imports
warn about unnecessary imports [dynamic]
-fwarn-unused-matches
warn about variables in patterns that aren't used [dynamic]

OPTIMISATION LEVELS

-O
Enable default optimisation (level 1) [dynamic]
-On
Set optimisation level n [dynamic]

INDIVIDUAL OPTIMISATIONS

-fcase-merge
Enable case-merging [dynamic]
-fdicts-strict
Make dictionaries strict [static]
-fdo-eta-reduction
Enable eta-reduction [dynamic]
-fdo-lambda-eta-expansion
Enable lambda eta-reduction [dynamic]
-fexcess-precision
Enable excess intermediate precision [static]
-frules-off
Switch off all rewrite rules (including rules generated by automatic specialisation of overloaded functions) [static]
-fignore-asserts
Ignore assertions in the source [static]
-fignore-interface-pragmas
Ignore pragmas in interface files [static]
-fliberate-case-threshold
Tweak the liberate-case optimisation (default: 10) [static]
-fomit-interface-pragmas
Don't generate interface pragmas [dynamic]
-fmax-worker-args
If a worker has that many arguments, none will be unpacked anymore (default: 10) [static]
-fmax-simplifier-iterations
Set the max iterations for the simplifier [dynamic]
-fno-state-hack
Turn off the "state hack" whereby any lambda with a real-world state token as argument is considered to be single-entry. Hence OK to inline things inside it. [static]
-fno-cse
Turn off common sub-expression [dynamic]
-fno-full-laziness
Turn off full laziness (floating bindings outwards). [dynamic]
-fno-pre-inlining
Turn off pre-inlining [static]
-fno-strictness
Turn off strictness analysis [dynamic]
-funbox-strict-fields
Flatten strict constructor fields [dynamic]
-funfolding-creation-threshold
Tweak unfolding settings [static]
-funfolding-fun-discount
Tweak unfolding settings [static]
-funfolding-keeness-factor
Tweak unfolding settings [static]
-funfolding-update-in-place
Tweak unfolding settings [static]
-funfolding-use-threshold
Tweak unfolding settings [static]

PROFILING OPTIONS

-auto
Auto-add CR_scc_s to all exported functions [static]
-auto-all
Auto-add CR_scc_s to all top-level functions [static]
-auto-dicts
Auto-add CR_scc_s to all dictionaries [static]
-caf-all
Auto-add CR_scc_s to all CAFs [static]
-prof
Turn on profiling [static]
-ticky
Turn on ticky-ticky profiling [static]

PARALLELISM OPTIONS

-gransim
Enable GRANSIM [static]
-parallel
Enable Parallel Haskell [static]
-smp
Enable SMP support [static]

C PRE-PROCESSOR OPTIONS

-cpp
Run the C pre-processor on Haskell source files [dynamic]
-Dsymbol=value
Define a symbol in the C pre-processor [dynamic]
-Usymbol
Undefine a symbol in the C pre-processor [dynamic]
-Idir
Add dir to the directory search list for CR#include files [static]

C COMPILER OPTIONS

-#include file
Include file when compiling the .hc file [dynamic]

CODE GENERATION OPTIONS

-fasm
Use the native code generator [dynamic]
-fvia-C
Compile via C [dynamic]
-fno-code
Omit code generation [static]

LINKING OPTIONS

-dynamic
Use dynamic Haskell libraries (if available) [static]
-framework name
On Darwin/MacOS X only, link in the framework name. This option corresponds to the -framework option for Apple's Linker. [static]
-framework-path name
On Darwin/MacOS X only, add dir to the list of directories searched for frameworks. This option corresponds to the -F option for Apple's Linker. [static]
-llib
Link in library lib [static]
-Ldir
Add dir to the list of directories searched for libraries [static]
-main-is
Set main function [static]
-no-hs-main
Don't assume this program contains CRmain [static]
-no-link
Omit linking [static]
-package name
Link in package name [static]
-split-objs
Split objects (for libraries) [static]
-static
Use static Haskell libraries [static]
-threaded
Use the threaded runtime [static]
-debug
Use the debugging runtime [static]

REPLACING PHASES

-pgmL cmd
Use cmd as the literate pre-processor [static]
-pgmP cmd
Use cmd as the C pre-processor (with -cpp only) [static]
-pgmc cmd
Use cmd as the C compiler [static]
-pgma cmd
Use cmd as the assembler [static]
-pgml cmd
Use cmd as the linker [static]
-pgmdll cmd
Use cmd as the DLL generator [static]
-pgmdep cmd
Use cmd as the dependency generator [static]
-pgmF cmd
Use cmd as the pre-processor (with -F only) [static]

FORCING OPTIONS TO PARTICULAR PHASES

-optL option
pass option to the literate pre-processor [dynamic]
-optP option
pass option to cpp (with -cpp only) [dynamic]
-optF option
pass option to the custom pre-processor [dynamic]
-optc option
pass option to the C compiler [dynamic]
-opta option
pass option to the assembler [dynamic]
-optl option
pass option to the linker [static]
-optdll option
pass option to the DLL generator [static]
-optdep option
pass option to the dependency generator [static]

PLATFORM-SPECIFIC OPTIONS

-mv8
(SPARC only) enable version 8 support [static]
-monly-[32]-regs
(x86 only) give some registers back to the C compiler [dynamic]

EXTERNAL CORE FILE OPTIONS

-fext-core
Generate .hcr external Core files [static]

COMPILER DEBUGGING OPTIONS

-dcore-lint
Turn on internal sanity checking [dynamic]
-ddump-absC
Dump abstract C [dynamic]
-ddump-asm
Dump assembly [dynamic]
-ddump-bcos
Dump interpreter byte code [dynamic]
-ddump-cpranal
Dump output from CPR analysis [dynamic]
-ddump-cse
Dump CSE output [dynamic]
-ddump-deriv
Dump deriving output [dynamic]
-ddump-ds
Dump desugarer output [dynamic]
-ddump-flatC
Dump `flat' C [dynamic]
-ddump-foreign
Dump CRforeign export stubs [dynamic]
-ddump-inlinings
Dump inlining info [dynamic]
-ddump-occur-anal
Dump occurrence analysis output [dynamic]
-ddump-parsed
Dump parse tree [dynamic]
-ddump-realC
Dump `real' C [dynamic]
-ddump-rn
Dump renamer output [dynamic]
-ddump-rules
Dump rules [dynamic]
-ddump-sat
Dump saturated output [dynamic]
-ddump-simpl
Dump final simplifier output [dynamic]
-ddump-simpl-iterations
Dump output from each simplifier iteration [dynamic]
-ddump-spec
Dump specialiser output [dynamic]
-ddump-stg
Dump final STG [dynamic]
-ddump-stranal
Dump strictness analyser output [dynamic]
-ddump-tc
Dump typechecker output [dynamic]
-ddump-types
Dump type signatures [dynamic]
-ddump-usagesp
Dump UsageSP analysis output [dynamic]
-ddump-worker-wrapper
Dump worker-wrapper output [dynamic]
-ddump-rn-trace
Trace renamer [dynamic]
-ddump-rn-stats
Renamer stats [dynamic]
-ddump-stix
Native code generator intermediate form [dynamic]
-ddump-simpl-stats
Dump simplifier stats [dynamic]
-dppr-debug
Turn on debug printing (more verbose) [static]
-dppr-noprags
Don't output pragma info in dumps [static]
-dppr-user-length
Set the depth for printing expressions in error msgs [static]
-dsource-stats
Dump haskell source stats [dynamic]
-dstg-lint
STG pass sanity checking [dynamic]
-dstg-stats
Dump STG stats [dynamic]
-dusagesp-lint
UsageSP sanity checker [dynamic]
-dverbose-core2core
Show output from each core-to-core pass [dynamic]
-dverbose-stg2stg
Show output from each STG-to-STG pass [dynamic]
-unreg
Enable unregisterised compilation [static]

MISC COMPILER OPTIONS

-femit-extern-decls
??? [static]
-fglobalise-toplev-names
Make all top-level names global (for -split-objs) [static]
-fno-hi-version-check
Don't complain about CR.hi file mismatches [static]
-dno-black-holing
Turn off black holing (probably doesn't work) [static]
-fno-method-sharing
Don't share specialisations of overloaded functions [static]
-fno-prune-decls
Renamer: don't prune declarations [static]
-fhistory-size
Set simplification history size [static]
-funregisterised
Unregisterised compilation (use -unreg instead) [static]
-fno-asm-mangling
Turn off assembly mangling (use -unreg instead) [static]

FILES

/usr/lib/ghc-6.4.1/

COPYRIGHT

Copyright 2002, The University Court of the University of Glasgow.

All rights reserved.

AUTHOR

This manual page was generated from the XML documentation of GHC with blood, sweat, tears and a breaks-if-you-look-at-it-the-wrong-way XSL stylesheet by Michael Weber <michaelw@debian.org> for the Debian GNU/Linux system (but may be used by others).

CETTE PAGE DOCUMENTE AUSSI :