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 `PreludeCore.hi' and `Prelude.hi' files for you. If you'd rather it didn't, then give it a `-fno-implicit-prelude' option. (Sadly, it still has to find a `PreludeNull_.hi' file; it just won't feed it into the compiler proper.) 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.

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.