0

I've just installed EclipseFP and now I am trying to load a module in GHCi. The problem is that GHCi doesn't load libraries installed by cabal, referenced by my module. After I set -v in GHCi and ran :r, it looks like GHCi is only looking for libraries that are installed globally, not libraries that are installed for the local user:

Could not find module `Text.ParserCombinators.Parsec'
There are files missing in the `parsec-3.1.3' package,
try running 'ghc-pkg check'.
Locations searched:
  Text/ParserCombinators/Parsec.hs
  Text/ParserCombinators/Parsec.lhs
  /Library/Haskell/ghc-7.6.3/lib/parsec-3.1.3/lib/Text/ParserCombinators/Parsec.hi

However, when I'm running GHCi in terminal or via Haskell-Mode in emacs, everything works just fine!

I am wondering if there is something wrong with my configuration in EclipseFP or if I can force GHCi to search for user local modules as well.

By the way, I have already tried -i option to pass the local search path to CHCi

-i~/Library/Haskell/ghc-7.6.3/lib/

but apparently, GHCi is only looking for source files (e.g., Parsec.hs and Parsec.lhs) but not interface files (Parsec.hi) in the specified path.

I would much appreciate it if you can help me experience the joy of Haskell programming in Eclipse!

Thanks!

Salman
  • 1
  • 2

1 Answers1

0

In Eclipse, a run configuration has been created for your GHCi run on your module. This will give you the exact parameters that are being passed to GHCi. It should reference the user package db and all the packages your module needs (make sure the proper dependencies are in the Cabal file). EclipseFP installs packages in the user db by default, so normally this works fine. You should not need to add specific directories to GHCi in EclipseFP.

JP Moresmau
  • 7,388
  • 17
  • 31
  • Thank you! I was missing the connection between the cabal file and GHCi. I made some progress but now buildwrapper is using an older version of cabal library than cabal-install. I found your response to a similar problem https://github.com/JPMoresmau/BuildWrapper/issues/18 . So, I guess I need to either rebuild my ghc (which is very painful via port) or downgrade cabal-install. – Salman Dec 24 '13 at 04:50
  • Yes, exactly, unfortunately we're stuck in a three way dependency with GHC and Cabal, so you need to use the same cabal version that what your ghc was built with. – JP Moresmau Dec 26 '13 at 14:50