cabal 更新后类型不匹配?
Type mismatch after cabal update?
程序具有以下导入:
import Pipes.Network.TCP
import Pipes
import Pipes.Core
import qualified Data.ByteString.Char8 as C
编译失败如下:
Couldn't match expected type `bytestring-0.9.2.1:Data.ByteString.Internal.ByteString'
with actual type `C.ByteString'
Expected type: Proxy
Int
bytestring-0.9.2.1:Data.ByteString.Internal.ByteString
()
b0
m0
()
Actual type: Proxy Int C.ByteString () C.ByteString IO ()
我可以更具体地说明代码,但看起来这与代码无关 - 而是阴谋集团的心血来潮。也许,我导入的 Pipes
被认为使用的 ByteString
与使用限定名称导入的
不同。
前段时间用来编译的程序(我有它的工作可执行文件),但现在它停止了,我怀疑可能有一些 cabal 更新或包安装。如何调试和修复此问题?
假设你的程序是用 cabal 构建的,你应该重新配置它。这可能会突出其他问题,例如需要重新安装或破坏依赖树的其他部分的依赖项。解决这个问题的 "old way" 是逐步 cabal install
越来越多的事情,直到依赖解决者同意它是可能的,例如
$ cabal install .
# complains that reinstalls might break lens
$ cabal install . lens
# complains that reinstalls might break bytestring
$ cabal install . lens bytestring
# complains that reinstalls might break X
$ cabal install . lens bytestring X
...等"new way"就是使用no-reinstall cabal。您仍然需要在构建之前重新配置,并且可能需要再次安装一些依赖项才能正确过渡。
程序具有以下导入:
import Pipes.Network.TCP
import Pipes
import Pipes.Core
import qualified Data.ByteString.Char8 as C
编译失败如下:
Couldn't match expected type `bytestring-0.9.2.1:Data.ByteString.Internal.ByteString'
with actual type `C.ByteString'
Expected type: Proxy
Int
bytestring-0.9.2.1:Data.ByteString.Internal.ByteString
()
b0
m0
()
Actual type: Proxy Int C.ByteString () C.ByteString IO ()
我可以更具体地说明代码,但看起来这与代码无关 - 而是阴谋集团的心血来潮。也许,我导入的 Pipes
被认为使用的 ByteString
与使用限定名称导入的
前段时间用来编译的程序(我有它的工作可执行文件),但现在它停止了,我怀疑可能有一些 cabal 更新或包安装。如何调试和修复此问题?
假设你的程序是用 cabal 构建的,你应该重新配置它。这可能会突出其他问题,例如需要重新安装或破坏依赖树的其他部分的依赖项。解决这个问题的 "old way" 是逐步 cabal install
越来越多的事情,直到依赖解决者同意它是可能的,例如
$ cabal install .
# complains that reinstalls might break lens
$ cabal install . lens
# complains that reinstalls might break bytestring
$ cabal install . lens bytestring
# complains that reinstalls might break X
$ cabal install . lens bytestring X
...等"new way"就是使用no-reinstall cabal。您仍然需要在构建之前重新配置,并且可能需要再次安装一些依赖项才能正确过渡。