【问题标题】:Haskell fay install failedHaskell 安装失败
【发布时间】:2012-12-23 10:41:47
【问题描述】:

我正在尝试安装 fay,但 src 编译失败

$ cabal install fay
...
Preprocessing executable 'fay' for fay-0.10.1.0...
[ 1 of 14] Compiling Data.List.Extra  ( src/Data/List/Extra.hs, dist/build/fay/fay- tmp/Data/List/Extra.o )
[ 2 of 14] Compiling System.Process.Extra ( src/System/Process/Extra.hs, dist/build/fay/fay-tmp/System/Process/Extra.o )    
...
[13 of 14] Compiling Language.Fay     ( src/Language/Fay.hs, dist/build/fay/fay-tmp/Language/Fay.o )
[14 of 14] Compiling Main             ( src/Main.hs, dist/build/fay/fay-tmp/Main.o )

src/Main.hs:89:55:
Couldn't match expected type `Either ParseError (Maybe String)'
            with actual type `Maybe b0'
Expected type: b0 -> Either ParseError (Maybe String)
  Actual type: b0 -> Maybe b0
In the first argument of `(.)', namely `Just'
In the first argument of `reader', namely `(Just . Just)'

src/Main.hs:96:35:
Couldn't match expected type `Either ParseError a0'
            with actual type `Maybe b0'
Expected type: b0 -> Either ParseError a0
  Actual type: b0 -> Maybe b0
In the first argument of `(.)', namely `Just'
In the first argument of `reader', namely
  `(Just . wordsBy (== ','))'
Failed to install fay-0.10.1.0
cabal: Error: some packages failed to install:
fay-0.10.1.0 failed during the building phase. The exception was:
ExitFailure 1

我不知道这是我的错误还是包装问题。

我正在使用:arch linux、ghc-7.4.2、cabal-1.16.0.3

【问题讨论】:

    标签: haskell cabal fay


    【解决方案1】:

    这绝对是一个包问题,因为没有足够严格地指定依赖项。如果一个包遵循Package Versioning Policy,如果你能满足依赖,包应该构建。

    查看 fay 包描述,我注意到几乎没有任何依赖项具有下限或上限。所以基本上,你必须进行实验。

    查看代码我看到错误中提到的readerOptions.Applicative.Builder.reader。此函数已在 0.4.3 和 0.5.0 之间更改了类型签名,因此请尝试通过将 --constraint "optparse-applicative < 0.5" 传递给 cabal install 来降级 optparse-applicative

    【讨论】:

    • 已解决。谢谢你。在 *.cabal 中,我指定安装 optparse-applicative 版本 0.4.3,并且安装时没有冲突。
    • 刚刚通过指定--constraint "optparse-applicative < 0.6" 解决了与yesod-bin-1.2.3.3 相同的问题。太棒了,谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-13
    • 2019-03-14
    • 1970-01-01
    • 1970-01-01
    • 2013-02-24
    • 1970-01-01
    • 2017-08-14
    相关资源
    最近更新 更多