2016-10-22 144 views
3

我在学习Haskell并尝试设置我的Emacs开发环境(请阅读this)。
我应该做的一件事是安装hindent
推荐方法0​​只是stack install hindent。我想它应该安装在堆栈的global-project空间中。在$HOME/.stack/global-project/stack.yaml我的全球栈YAML是:Haskell堆栈的基本用法失败

flags: {} 
extra-package-dbs: [] 
packages: [] 
extra-deps: [] 
resolver: ghc-7.10.3 

我不使用任何系统ghc(有我的$PATH没有ghcghci)。
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 

当我提出它提出了一些新的依赖(这可能是依赖关系的那些前加入的)等。在它导致situatuation结束其中一些两个依赖项具有未满足的版本。

我认为我的配置(或理解堆栈)有问题,因为我认为获得隐式依赖关系是构建工具的工作。

有人更有经验可以推断出我的初学者有什么错?

+2

为什么你的全球项目中的解析器是'ghc-7.10.3'有什么特别的理由吗? (我认为这可能是您问题的根源。) – duplode

回答

4

通常不推荐使用ghc版本作为解析器,因为您发现的原因:您需要手动指定大量的软件包版本。相反,我建议切换到lts-6.23或其他类似的东西。

+0

谢谢。这很有道理,但与迄今为止我所见过的其他生态系统中的标准构建工具有点不同。通过'lts-6.23'甚至'lts-7.5'安装的'hindent'版本是<5但我需要5>。我已经切换到每晚得到我需要的东西。根据堆栈原理,我的理由是否正确,或者我应该在某处指定特定版本的单个包('hindent')? – foki

+1

您可以尝试在命令行上指定版本,但选择期望版本的夜间快照是一个很好的调用。 –

0

不确定。如果你只是想快速移动:

stack upgrade --git && \ 
rm -rf ~/.stack  && \ 
stack setup   && \ 
stack install hindent 

为什么不使用GHC 8.X和新的新堆栈? ;)