我试图用ghc-7.8.3构建ghc-mtl-1.2.1.0,并得到以下错误消息:
Control/Monad/Ghc.hs:42:15:
No instance for (GHC.MonadIO Ghc)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (GHC.ExceptionMonad Ghc)
Control/Monad/Ghc.hs:46:15:
No instance for (MonadIO GHC.Ghc)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (MonadIO Ghc)
Control/Monad/Ghc.hs:49:15:
No instance for (GHC.MonadIO Ghc)
arising from the 'deriving' clause of a data type declaration
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (GHC.GhcMonad Ghc)
同样的错误与ghc-7.8.2。
我已经尝试找出在称为Ghc
和/或GHC
和/或MonadIO
的9000多个类型和/或模块中,哪种类型和/或模块负责,但到目前为止还没有结果。
所以我的问题是:
发布于 2014-07-20 19:18:32
回答我自己的问题。
问题是变压器-0.4.1.0软件包,这是安装在变压器旁边-0.3.0.0,随ghc而来。变压器包提供Control.Monad.IO.Class.MonadIO
类。它被拉到构建两次,一次从变压器-0.4.1.0和一次从变压器-0.3.0.0,这导致了冲突。
我已经看到了重复的包,但没有意识到它是问题的根源。我的错误是,我有隐藏变压器-0.4.1.0与ghc-pkg hide
,试图构建ghc,问题持续存在,我决定变压器不是原因。当然,躲藏是不够的,我应该把它移除。
卸载变压器-0.4.1.0并降低其依赖性解决了问题。
https://stackoverflow.com/questions/24844604
复制相似问题