cabal的Haskell错误:没有实例

时间:2017-12-12 01:42:27

标签: haskell cabal cabal-install

我尝试按照安装步骤来推导名为hephaestus-pl的软件产品系列。但是,在执行安装步骤时,根据教程,在所有克隆的存储库上执行cabal install命令时会出错。错误是:

$ sudo cabal install
Resolving dependencies...
Notice: installing into a sandbox located at
/home/notebook/workspace/hephaestus/hephaestus-sb
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Failed to install funsat-0.6.2
Build log ( /home/notebook/workspace/hephaestus/hephaestus-sb/logs/funsat-0.6.2.log ):
cabal: Entering directory '.'
Configuring funsat-0.6.2...
Building funsat-0.6.2...
Preprocessing library funsat-0.6.2...
[ 4 of 10] Compiling Funsat.Monad     ( src/Funsat/Monad.hs, dist/dist-sandbox-cf02e0bc/build/Funsat/Monad.o )

src/Funsat/Monad.hs:64:10: error:
    • No instance for (Applicative (SSTErrMonad e st s))
        arising from the superclasses of an instance declaration
    • In the instance declaration for ‘Monad (SSTErrMonad e st s)’

src/Funsat/Monad.hs:88:10: error:
    • Could not deduce (GHC.Base.Alternative (SSTErrMonad e st s))
        arising from the superclasses of an instance declaration
      from the context: Error e
        bound by the instance declaration at src/Funsat/Monad.hs:88:10-52
    • In the instance declaration for ‘MonadPlus (SSTErrMonad e st s)’
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
funsat-0.6.2 failed during the building phase. The exception was:
ExitFailure 1

我使用的是ghci的以下版本,它随haskell-platform:一起安装

$ ghci 
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help

阴谋版本是:

$ cabal --version
cabal-install version 1.24.0.1
compiled using version 1.24.1.0 of the Cabal library

我的操作系统是debian 9.2

1 个答案:

答案 0 :(得分:2)

由于更新版本的GHC中实现了Functor/Applicative/Monad proposal,因此无法编译。该代码最初编译得很好,但在最新版本的GHC中,如果没有先将其声明为testpropMonad,则无法将其声明为Functor。你曾经能够,但现在你不能。

库作者需要更新库的代码以修复此新限制。