GHC无法在新安装的Haskell-Platform上找到库 [英] GHC cannot find libraries on fresh install of Haskell-Platform
问题描述
$ brew cask install haskell-platform
不作任何修改。当我尝试使用 parsec
导入时编译程序时,Haskell-Platform无法找到它:
$ ghc -v test.hs
...
软件包parsec-3.1.11-DPgnR92AWEaFOaixmwipet由于被隐藏的依赖关系而不可用:
mtl-2.2.1- 19EL8AGBsN3DnnOhrC9xY3 text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
...
test.hs:2:1:error:
无法找到模块'Text.Parsec'
搜索的位置:
Text / Parsec.hs
Text / Parsec.lhs
Text / Parsec.hsig
Text / Parsec.lhsig
|
2 |导入Text.Parsec
| ^^^^^^^^^^^^^^^^^^
安装了parsec :
$ ghc-pkg list | grep -e'parsec'
attoparsec-0.13.2.0
parsec-3.1.11
所以我有几个问题:
- 阴影依赖是什么意思?
- GHC在哪里查找库?
- GHC在哪里查找用户库和系统范围库?
- 这条路可以修改吗? 平台的构建,并发布了一个新版本,以解决您遇到的问题。
该错误的详细信息以及新版本均在 https://mail.haskell.org/pipermail/haskell-cafe/2017-October/127979 .html
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?
There was a bug with 8.2.1 binary platform builds, and a new release was cut to fix the issue you encountered.
Details on the bug, and the new release are provided at https://mail.haskell.org/pipermail/haskell-cafe/2017-October/127979.html
这篇关于GHC无法在新安装的Haskell-Platform上找到库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!