2016-10-22 147 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和新的新堆棧? ;)