在重复的实例声明上安装agda失败

时间:2014-07-25 21:07:09

标签: agda

我正试图给agda一个镜头,但我无法安装它。我在一个cabal沙箱中运行GHC 7.8.3。

Failed to install Agda-2.4.0.1
Build log ( /Users/jsnavely/project/agda/.cabal-sandbox/logs/Agda-2.4.0.1.log ):
[1 of 1] Compiling Main             ( /var/folders/dh/ckhr9p0j3kq3bx12176p7rlw0000gn/T/Agda-2.4.0.1-77992/Agda-2.4.0.1/dist/dist-sandbox-eeb4211c/setup/setup.hs, /var/folders/dh/ckhr9p0j3kq3bx12176p7rlw0000gn/T/Agda-2.4.0.1-77992/Agda-2.4.0.1/dist/dist-sandbox-eeb4211c/setup/Main.o )
Linking /var/folders/dh/ckhr9p0j3kq3bx12176p7rlw0000gn/T/Agda-2.4.0.1-77992/Agda-2.4.0.1/dist/dist-sandbox-eeb4211c/setup/setup ...
Configuring Agda-2.4.0.1...
Building Agda-2.4.0.1...
Preprocessing library Agda-2.4.0.1...
[  1 of 272] Compiling Agda.Utils.Maybe.Strict ( src/full/Agda/Utils/Maybe/Strict.hs, dist/dist-sandbox-eeb4211c/build/Agda/Utils/Maybe/Strict.o )
[  2 of 272] Compiling Agda.Utils.SemiRing ( src/full/Agda/Utils/SemiRing.hs, dist/dist-sandbox-eeb4211c/build/Agda/Utils/SemiRing.o )
[  3 of 272] Compiling Agda.TypeChecking.Monad.Debug ( src/full/Agda/TypeChecking/Monad/Debug.hs, dist/dist-sandbox-eeb4211c/build/Agda/TypeChecking/Monad/Debug.o )
[  4 of 272] Compiling Agda.Utils.Cluster ( src/full/Agda/Utils/Cluster.hs, dist/dist-sandbox-eeb4211c/build/Agda/Utils/Cluster.o )

src/full/Agda/Utils/Cluster.hs:50:10:
    Duplicate instance declarations:
      instance Monad m => Functor (EquivT s x y m)
        -- Defined at src/full/Agda/Utils/Cluster.hs:50:10
      instance Functor m => Functor (EquivT s c v m)
        -- Defined in ‘Data.Equivalence.Monad’
cabal: Error: some packages failed to install:
Agda-2.4.0.1 failed during the building phase. The exception was:
ExitFailure 1

我很乐意打开cabal包装,但我不确定我会弄到什么。我们可以删除其中一个定义吗?

2 个答案:

答案 0 :(得分:1)

问题是equivalence库(hackage)没有为Functor定义EquivT实例,因此Agda定义了自己的实例。最新版本(0.2.4及更高版本)添加了这个缺失的实例,现在与Agda版本存在冲突。

您基本上有两种选择:降级到equivalence-0.2.3或从Agda源文件中删除实例。我检查了,实现匹配。但是,Agda有不同的约束(从错误消息中可以看出):

instance Monad   m => Functor (EquivT s x y m)  -- Agda
instance Functor m => Functor (EquivT s c v m)  -- equivalence

因此,虽然可以安全地删除实例,但是可能(尽管不太可能)会出现一些破坏的类型类约束 - 例如,具有Monad实例但没有Functor的类型之一。

另请考虑在official bugtracker上报告此问题。据我所知,尚未有报道。

答案 1 :(得分:1)

此问题已在Agda的git(hub)版本中修复。修复程序将以2.4.0.2发布。