[Haskell-cafe] Can't use libraries in haskell

Evan Laforge qdunkan at gmail.com
Sun Jun 26 09:10:50 CEST 2011

> What's wrong? How can i install and use library in haskell?

First thing is to do 'ghc-pkg list'.  If your package doesn't show up
then it's not installed, according to the package registry.  'cabal
install' should have registered it.  If it is in the list, then it
depends how you're building.  If you use ghc manually, then you have
to give '-package xyz'.  If you use 'ghc --make', ghc will
automatically add the -package for you.  If you use cabal, you put the
package in the dependencies, and 'cabal build' will add -package for

If the package has parens, then someone hid it, and you'll have to do
'ghc-pkg expose' on it.  If you're doing everything else right and it
still doesn't find the package, then you can run ghc -v and it'll
print lots of details.  It might have something about 'hiding xyz
because of <some version thing>', which means you're depending on
libraries that expect different versions of the underlying library.
You can sometimes get out of this by carefully upgrading or
downgrading certain libraries.

More information about the Haskell-Cafe mailing list