如何修复 cabal 安装错误

How to fix cabal installation error

尝试使用 Cabal 安装逆变库(镜头需要)时出现以下错误:

``src/Data/Functor/Contravariant.hs:96:1: StateVar-1.1.0.0:Data.StateVar 无法安全导入!模块本身并不安全。''

我用谷歌搜索解决方案没有成功,并尝试了一些修复(例如摆脱我所有的 Haskell 包(使用 ``rm -r ~/.ghc'')并开始再次),但我不太清楚导致此错误发生的原因。我正在使用 ghc 7.4.1 - 这可能是问题所在吗?

谢谢,

鲁本

将评论中的正确答案发布为社区维基:

Looks like you're being hit by interactions between an old GHC and the lack of Safe Haskell annotations (in the library) that are redundant with newer GHC versions. Cf. http://github.com/ekmett/ersatz/issues/13