haskell - 安装 scion 浏览器时出错

标签 haskell cabal

尝试安装 scion-browser 软件包时出现以下错误,如下所示:

% cabal install scion-browser-0.2.9
<snipped>
[23 of 23] Compiling Main             ( src/Main.hs, dist/build/scion-browser/scion-browser-tmp/Main.o )

src/Main.hs:31:24:
    No instance for (MonadException BrowserM)
      arising from a use of `getInputLine'
    Possible fix:
      add an instance declaration for (MonadException BrowserM)
    In a stmt of a 'do' block: maybeLine <- getInputLine ""
    In the expression:
      do { maybeLine <- getInputLine "";
           case maybeLine of {
             Nothing -> return ()
             Just line -> do { ... } } }
    In an equation for `loop':
        loop
          = do { maybeLine <- getInputLine "";
                 case maybeLine of {
                   Nothing -> return ()
                   Just line -> ... } }
cabal: Error: some packages failed to install:
scion-browser-0.2.9 failed during the building phase. The exception was:
ExitFailure 1

知道如何解决这个问题吗?

谢谢。

最佳答案

问题是 haskeline-0.7.0.0更改了使用的StateT类型。在 haskeline < 0.7 ,它使用了 Control.Monad.State模块来自mtl ,在版本 0.7.0.0 中,haskeline放弃了对 mtl 的依赖并使用 StateT transformers 的 Monad 变压器直接打包。这本身不是问题,因为 mtl现在只是 transformers 的包装。然而haskeline使用的模块是 Control.Monad.Trans.State.Strict ,而Control.Monad.State来自mtl包裹Control.Monad.Trans.State.Lazy 。因此

instance MonadException m => MonadException (StateT s m) where
    controlIO f = StateT $ \s -> controlIO $ \(RunIO run) -> let
                    run' = RunIO (fmap (StateT . const) . run . flip runStateT s)
                    in fmap (flip runStateT s) $ f run'

来自 System.Console.Haskeline.MonadException不再适用于StateTscion-browser 使用.

简单的解决方法是限制 haskeline到早期版本,

cabal install --constraint="haskeline < 0.7" scion-browser

另一个修复是更改 scion-browser 中的导入来源Control.Monad.State.Strict使其构建为 haskeline-0.7.0.0 .

关于haskell - 安装 scion 浏览器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11617335/

相关文章:

haskell - 模式匹配并非详尽无遗,即使我指定了模式

haskell - Haskell 中 OOP 风格的可显示列表?

haskell - 使用依赖项 pandoc-citeproc 在 Haskell 中构建独立的二进制可执行文件

haskell - cabal 说 "The following packages are likely to be broken by the reinstalls"是什么意思

haskell - 某些用户的 cabal 安装时未出现进度消息

haskell - 你能在同一个 cabal 包中有一个可执行文件和库吗

haskell - 如何模仿懒惰

haskell - 在 Haskell 中显示未知类型的列表

在 El Capitan 更新后 Haskell 和 Cabal 失踪

haskell - 具有持续集成的 HUnit/QuickCheck