I'm trying to learn how to use Haskell, but I've run into a little roadblock. I'm using MacOSX 10.12.6 and installed Haskell Platform using:
$ brew cask install haskell-platform
with no modifications. When I try to compile a program with parsec
imported, Haskell-Platform can't find it:
$ ghc -v test.hs
...
package parsec-3.1.11-DPgnR92AWEaFOaixmwipet is unusable due to shadowed dependencies:
mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3 text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
...
test.hs:2:1: error:
Could not find module ‘Text.Parsec’
Locations searched:
Text/Parsec.hs
Text/Parsec.lhs
Text/Parsec.hsig
Text/Parsec.lhsig
|
2 | import Text.Parsec
| ^^^^^^^^^^^^^^^^^^
parsec is installed:
$ ghc-pkg list | grep -e 'parsec'
attoparsec-0.13.2.0
parsec-3.1.11
So I have a few questions:
- What does it mean by shadowed dependencies?
- Where does GHC look for libraries?
- Where does GHC look for user libraries vs system wide libraries?
- Can this path be modified?