该hmatrix
软件包包含以下类型系列代码:
type family BoundsOf x
type instance BoundsOf (a->a) = Int
type instance BoundsOf (a->a->a) = (Int,Int)
在 GHC 7.6 上,这编译得很好。
在 GHC 7.7(导致 7.8)上,我们得到:
lib/Numeric/ContainerBoot.hs:515:15:
Conflicting family instance declarations:
BoundsOf (a -> a) -- Defined at lib/Numeric/ContainerBoot.hs:515:15
BoundsOf (a -> a -> a)
-- Defined at lib/Numeric/ContainerBoot.hs:516:15
这里的“冲突”是什么意思?我看不到这些实例的问题。
更新:这是一个最小的例子Test.hs
:
{-# LANGUAGE TypeFamilies #-}
module Test where
type family BoundsOf x
type instance BoundsOf (a->a) = Int
type instance BoundsOf (a->a->a) = (Int,Int)
尝试这样做:
ghci Test.hs # 7.6, all fine
ghci-7.7 Test.hs # fails