【问题标题】:Cannot install Haskell package stream-fusion-0.1.2.5: Ambiguous occurence无法安装 Haskell 包 stream-fusion-0.1.2.5:出现歧义
【发布时间】:2016-02-07 08:43:11
【问题描述】:

我正在尝试构建需要包stream-fusion-0.1.2.5 的项目Barbarosa。但是 cabal install 失败并显示以下内容

[3 of 3] Compiling Control.Monad.Stream ( Control/Monad/Stream.hs, dist/dist-sandbox-8bb5b9c9/build/Control/Monad/Stream.o )

Control/Monad/Stream.hs:136:10:
    Ambiguous occurrence ‘MonadPlus’
    It could refer to either ‘Control.Monad.Stream.MonadPlus’,
                            defined at Control/Monad/Stream.hs:124:1
                          or ‘GHC.Base.MonadPlus’,
                            imported from ‘GHC.Base’ at Control/Monad/Stream.hs:80:1-15

Control/Monad/Stream.hs:140:10:
    Ambiguous occurrence ‘MonadPlus’
    It could refer to either ‘Control.Monad.Stream.MonadPlus’,
                            defined at Control/Monad/Stream.hs:124:1
                          or ‘GHC.Base.MonadPlus’,
                          imported from ‘GHC.Base’ at Control/Monad/Stream.hs:80:1-15

我在 OS X 10.11 上使用 GHC 版本 7.10.2,通过 Haskell 平台安装。

似乎stream-fusion的唯一依赖是base,其版本应该没问题,所以我不确定这里有什么问题。

【问题讨论】:

  • 该包的 Control.Monad.Stream 模块定义了自己的 MonadPlus 类型类。我认为这个包简直烂透了。
  • 我怀疑 GHC.Base 没有用来导出 MonadPlus,但是 7.10 的变化使事情发生了变化。

标签: haskell cabal cabal-install stream-fusion


【解决方案1】:

我能够通过替换三个出现的

来编译
import Data.List.Stream

与:

import Data.List

并从 cabal 文件的 build-depends: 部分中删除 stream-fusion

【讨论】:

    猜你喜欢
    • 2010-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 1970-01-01
    • 2016-05-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多