Go to the first, previous, next, last section, table of contents.

For finding interface files, etc.

In your program, you import a module `Foo' by saying `import Foo'. GHC goes looking for an interface file, `Foo.hi'. It has a builtin list of directories (notably including `.') where it looks.

The `-i<dirs>' option prepends a colon-separated list of `dirs' to the "import directories" list.

A plain `-i' resets the "import directories" list back to nothing.

GHC normally imports `Prelude.hi' files for you. If you'd rather it didn't, then give it a `-fno-implicit-prelude' option. You are unlikely to get very far without a Prelude, but, hey, it's a free country.

If you are using a system-supplied non-Prelude library (e.g., the HBC library), just use a `-syslib hbc' option (for example). The right interface files should then be available.

Once a Haskell module has been compiled to C (`.hc' file), you may wish to specify where GHC tells the C compiler to look for `.h' files. (Or, if you are using the `-cpp' option, where it tells the C pre-processor to look...) For this purpose, use a `-I<dir>' in the usual C-ish way.

Pragmas: Interface files are normally jammed full of compiler-produced pragmas, which record arities, strictness info, etc. If you think these pragmas are messing you up (or you are doing some kind of weird experiment), you can tell GHC to ignore them with the `-fignore-interface-pragmas' option.

When compiling without optimisations on, the compiler is extra-careful about not slurping in data constructors and instance declarations that it will not need. If you believe it is getting it wrong and not importing stuff which you think it should, this optimisation can be turned off with `-fno-prune-tydecls' and `-fno-prune-instdecls'.

See also section See section Linking and consistency-checking, which describes how the linker finds standard Haskell libraries.

Go to the first, previous, next, last section, table of contents.