我正在尝试构建需要包Barbarosa的项目stream-fusion-0.1.2.5。但是,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
,其版本应该没问题,所以我不确定这里的错误。
答案 0 :(得分:1)
我能够通过替换
的三次出现来编译import Data.List.Stream
使用:
import Data.List
并从cabal文件的stream-fusion
部分删除build-depends:
。