[Haskell-cafe] Cabal in ghc 6.4.2

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Sun Jul 30 09:20:45 EDT 2006

On Sun, 2006-07-30 at 15:01 +0100, allan wrote:

> however with version 6.4.2 I get the following error:
> haskellprint$ ./Setup.hs  build
> Preprocessing executables for haskellprint-0.1...
> Building haskellprint-0.1...
> Chasing modules from: Main.hs
> Could not find module `Text.ParserCombinators.Parsec':
>   use -v to see a list of the files searched for
>   (imported from ./Parser.hs)

The Text.ParserCombinators.Parsec modules are in the parsec module.

> build-depends:  base

Add parsec here:

build-depends:  base, parsec

The reason it works when you run it without -hide-all-packages is that
by default for convenience all packages are 'exposed'. That is they can
be used without explicitly having to specify them. However it was felt
that for distributing software, which is one of the main purposes of
Cabal, one should be fully explicit about the dependencies so that users
compiling on other machines know exactly what packages needed and don't
end up with mysterious import errors.

Now it's true that Cabal could be a bit cleverer here and warn you
before it even starts compiling that you have not specified all the
right packages in the build-depends. At the moment however Cabal doesn't
have a proper imports chaser so it can't do this.


More information about the Haskell-Cafe mailing list