我正在学习Haskell,并尝试设置我的Emacs开发环境(参考这里)。
其中一件事情是安装hindent
。
推荐的方法在这里只需要运行stack install hindent
。我猜应该安装在stack的global-project
空间中。我全局的stack yaml文件位于$HOME/.stack/global-project/stack.yaml
。
flags: {}
extra-package-dbs: []
packages: []
extra-deps: []
resolver: ghc-7.10.3
我没有使用任何系统 ghc
(我的 $PATH
上没有 ghc
或 ghci
)。
在执行 stack install hindent
时,它建议我扩展 extra-deps
:
Run from outside a project, using implicit global project config
Using resolver: ghc-7.10.3 from implicit global project's config file: /home/me/.stack/global-project/stack.yaml
While constructing the build plan, the following exceptions were encountered:
In the dependencies for hindent-5.2.1:
descriptive must match >=0.7 && <0.10, but the stack configuration has no specified version
(latest applicable is 0.9.4)
exceptions must match -any, but the stack configuration has no specified version (latest applicable is 0.8.3)
haskell-src-exts must match >=1.18, but the stack configuration has no specified version
(latest applicable is 1.18.2)
monad-loops must match -any, but the stack configuration has no specified version (latest applicable is 0.4.3)
mtl must match -any, but the stack configuration has no specified version (latest applicable is 2.2.1)
path must match -any, but the stack configuration has no specified version (latest applicable is 0.5.9)
path-io must match -any, but the stack configuration has no specified version (latest applicable is 1.2.0)
text must match -any, but the stack configuration has no specified version (latest applicable is 1.2.2.1)
unix-compat must match -any, but the stack configuration has no specified version (latest applicable is 0.4.2.0)
utf8-string must match -any, but the stack configuration has no specified version (latest applicable is 1.0.1.1)
yaml must match -any, but the stack configuration has no specified version (latest applicable is 0.8.20)
Recommended action: try adding the following to your extra-deps in /home/me/.stack/global-project/stack.yaml:
- descriptive-0.9.4
- exceptions-0.8.3
- haskell-src-exts-1.18.2
- monad-loops-0.4.3
- mtl-2.2.1
- path-0.5.9
- path-io-1.2.0
- text-1.2.2.1
- unix-compat-0.4.2.0
- utf8-string-1.0.1.1
- yaml-0.8.20
当我执行所提出的操作时,它会建议一些新的依赖项(这些可能是先前添加的依赖项的依赖项等等)。最终导致两个依赖项存在不满足版本的情况。我认为我的配置有问题(或者对栈的理解有误),因为我认为获取隐式依赖关系是构建工具的工作。是否有更有经验的人可以推断出我的初学者错误?
ghc-7.10.3
?(我认为这可能是你遇到问题的原因。) - duplode